diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2022-12-05 16:19:57 +0100 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2022-12-05 16:19:57 +0100 |
commit | 7f6a7b664bbfe95a7052fab24499ed58732a1cfb (patch) | |
tree | 2171bfc52146b9e95a0f980f9c00787fdae3fabb /src | |
parent | 70f1d0d71de033183fb2aed5533ec6937780a5a0 (diff) |
log: add file handler for ogLive "real time log"
Clients running in ogLive can show log messages via a lighttp server.
Particularly, a html page named "real time log" consists of <text-area>
tags with the contents of two particular text files
/tmp/session.log and /tmp/command.log
Adds a Python logging handler in order to write ogClient log messages
into /tmp/session.log. This way ogClient logs are show in the "real time
log" html page too.
Diffstat (limited to 'src')
-rw-r--r-- | src/log.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -58,8 +58,17 @@ def _default_logging_live(): 'filename': f'/opt/opengnsys/log/{getifaddr(os.getenv("DEVICE"))}.log', } } + rtlog = { + 'rtlog': { + 'class': 'logging.FileHandler', + 'formatter': 'formatter.syslogtime', + 'filename': f'/tmp/session.log', + } + } logconfig['handlers'].update(samba) + logconfig['handlers'].update(rtlog) logconfig['loggers']['']['handlers'].append('samba') + logconfig['loggers']['']['handlers'].append('rtlog') return logconfig |