From 0ab9be2ae039830e78205b1f426dfa8adca17eaf Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 22 Jul 2026 19:58:32 -0700 Subject: [PATCH] log: Set simpler syslog identifier instead of full binary path Tests: - When watching journal using 'sudo freedombox-logs' command, the syslog identifier for main service is 'freedombox' and for privileged service is 'freedombox-privileged'. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/log.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plinth/log.py b/plinth/log.py index 02d23c917..ed3a5c2f9 100644 --- a/plinth/log.py +++ b/plinth/log.py @@ -95,7 +95,8 @@ def action_init(console: bool = False): """Initialize logging for action scripts.""" _capture_warnings() - configuration = get_configuration() + configuration = get_configuration( + syslog_identifier='freedombox-privileged') if console: configuration['root']['handlers'] = ['console'] else: @@ -125,7 +126,7 @@ def setup_cherrypy_static_directory(app): app.log.error_log.propagate = False -def get_configuration(): +def get_configuration(syslog_identifier='freedombox'): """Return the main python logging module configuration.""" configuration = { 'version': 1, @@ -143,7 +144,8 @@ def get_configuration(): 'formatter': 'color' }, 'journal': { - 'class': 'systemd.journal.JournalHandler' + 'class': 'systemd.journal.JournalHandler', + 'SYSLOG_IDENTIFIER': syslog_identifier, } }, 'root': {