Skip to content

Commit 6c7a5a4

Browse files
Merge pull request #61557 from nextcloud/backport/61532/stable34
[stable34] perf(log): normalize log data only when logging
2 parents eb8bf83 + 00b4f19 commit 6c7a5a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/private/Log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ public function logData(string $message, array $data, array $context = []): void
373373
$level = $context['level'] ?? ILogger::ERROR;
374374

375375
$minLevel = $this->getLogLevel($context, $message);
376-
$data = array_map($this->normalizer->format(...), $data);
377376

378377
try {
379378
if ($level >= $minLevel) {
379+
$data = array_map($this->normalizer->format(...), $data);
380380
$data['message'] = $message;
381381
if (!$this->logger instanceof IFileBased) {
382382
$data = json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_UNESCAPED_SLASHES);

0 commit comments

Comments
 (0)