Skip to content

Commit 2720b3e

Browse files
committed
Fixing logging message creation
1 parent 6b91966 commit 2720b3e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

os2web_logging.services.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ parameters:
44
default: ['os2web_logging_watchdog', 'drupal.dblog']
55
# Log php channel to web server's error log.
66
php: ['error_log']
7-
os2web_logging.access_log:
8-
handlers: ['os2web_logging_access_log_file', 'drupal.os2web_logging_access_log_dblog']
9-
formatter: 'json'
7+
os2web_logging.access_log: ['os2web_logging_access_log_file', 'drupal.os2web_logging_access_log_dblog']
108

119
services:
1210
monolog.handler.os2web_logging_watchdog:

src/Logger/AccessLogsDbLog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function log($level, $message, array $context = []) {
2525
$message .= $this->t('Request URI has been truncated due to max_length restriction.') . PHP_EOL;
2626
}
2727
AccessLog::create([
28-
'sid' => $context['sid'],
28+
'sid' => $context['sid'] ?? NULL,
2929
'uid' => $context['uid'],
3030
'message' => $message,
3131
'ip' => mb_substr($context['ip'], 0, 15),

0 commit comments

Comments
 (0)