diff --git a/plinth/log.py b/plinth/log.py index e34a02f47..d77a66d5d 100644 --- a/plinth/log.py +++ b/plinth/log.py @@ -90,13 +90,16 @@ def _capture_warnings(): warnings.filterwarnings('default', '', ImportWarning) -def action_init(): +def action_init(console: bool = False): """Initialize logging for action scripts.""" _capture_warnings() configuration = get_configuration() - # Don't log to console - configuration['root']['handlers'] = ['journal'] + if console: + configuration['root']['handlers'] = ['console'] + else: + configuration['root']['handlers'] = ['journal'] + logging.config.dictConfig(configuration) diff --git a/plinth/privileged_daemon.py b/plinth/privileged_daemon.py index 7cfd256a5..66102718e 100644 --- a/plinth/privileged_daemon.py +++ b/plinth/privileged_daemon.py @@ -207,7 +207,7 @@ class Server(socketserver.ThreadingUnixStreamServer): def client_main() -> None: """Parse arguments for the client for privileged daemon.""" - log.action_init() + log.action_init(console=True) parser = argparse.ArgumentParser() parser.add_argument('module', help='Module to trigger action in')