mirror of
https://github.com/nextcloud/server.git
synced 2026-07-16 23:12:04 -04:00
perf(log): normalize log data only when logging
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
This commit is contained in:
parent
19f716f416
commit
00b4f19ffd
1 changed files with 1 additions and 1 deletions
|
|
@ -373,10 +373,10 @@ class Log implements ILogger, IDataLogger {
|
|||
$level = $context['level'] ?? ILogger::ERROR;
|
||||
|
||||
$minLevel = $this->getLogLevel($context, $message);
|
||||
$data = array_map($this->normalizer->format(...), $data);
|
||||
|
||||
try {
|
||||
if ($level >= $minLevel) {
|
||||
$data = array_map($this->normalizer->format(...), $data);
|
||||
$data['message'] = $message;
|
||||
if (!$this->logger instanceof IFileBased) {
|
||||
$data = json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_UNESCAPED_SLASHES);
|
||||
|
|
|
|||
Loading…
Reference in a new issue