Allow to configure syslog tag (#3596)

* Allow to configure syslog tag

Author-Change-Id: IB#1120629

* Update InitializeProcessor.php
This commit is contained in:
Paweł Bogusławski 2022-06-15 18:38:59 +02:00 committed by GitHub
parent 024964eafb
commit b9800b7c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -1156,6 +1156,13 @@ form:
local6: local6
local7: local7
log.syslog.tag:
type: text
size: small
label: PLUGIN_ADMIN.SYSLOG_TAG
help: PLUGIN_ADMIN.SYSLOG_TAG_HELP
placeholder: "grav"
debugger:
type: tab
title: PLUGIN_ADMIN.DEBUGGER

View File

@ -144,6 +144,7 @@ log:
handler: file # Log handler. Currently supported: file | syslog
syslog:
facility: local6 # Syslog facilities output
tag: grav # Syslog tag. Default: "grav".
debugger:
enabled: false # Enable Grav debugger and following settings

View File

@ -251,7 +251,8 @@ class InitializeProcessor extends ProcessorBase
$log->popHandler();
$facility = $config->get('system.log.syslog.facility', 'local6');
$logHandler = new SyslogHandler('grav', $facility);
$tag = $config->get('system.log.syslog.tag', 'grav');
$logHandler = new SyslogHandler($tag, $facility);
$formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%");
$logHandler->setFormatter($formatter);