7 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
ce3668d5e8
log, email_server: Don't use syslog instead of journald
- Syslog is not used on FreedomBox machines. Logging to syslog instead of
journald looses a lot of information fields that are otherwise available.

- Drop logging additional information. Most of the information is already
present in full journald records. Access using journalctl -o json.

- Use the same formatting for console as the primary daemon.

- When logging for actions, capture warnings too.

- Always log to stderr so that UI can capture the traceback and show UI error
messages. stderr is never used for returning data.

Tests:

- Run action script using command line with a error 'sudo actions/email_server
home mk a b'. See the traceback message printed on stderr (not stdout). Message
is printed with full field information in journalctl -o json.

- Main daemon writes to stderr and to journal with same formatting as before.

- Adding a warning in action code or main daemon results in printing of the
warning with desired formatting. import warnings; warnings.warn('Foo warning')

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:10:52 -04:00
fliu
aab3fe9c02
email, plinth.log: Write more information to syslog
sudo journalctl -b -o short-monotonic --no-pager -f
2021-08-17 19:43:01 -07:00
Sunil Mohan Adapa
a145742ebc
log: Allow setting the default log level before log configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:02:00 -04:00
Sunil Mohan Adapa
9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00
Sunil Mohan Adapa
67ac86899a
log: Ability to log SQL queries (disabled by default)
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-10 18:13:04 -05:00
Sunil Mohan Adapa
6afbd0d9fc
logging: Implement colors for console messages
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-23 17:18:25 -05:00
Sunil Mohan Adapa
bc55edd186
logging: Separate logging init logic into a module
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-12-23 17:18:21 -05:00