Open alxmrs opened 3 years ago
Logging does need more options. For the most part, stdout/stderr logging covers things like systemd and containers, but might not be ideal for some setups. I propose:
StreamHandler
)simple
for WatchedFileHandler
rotate_time
for TimedRotatingFileHandler
rotate_size
for RotatingFileHandler
Configuration could look something like:
[logging]
# simple | rotate_time | rotate_size
handler = rotate_size
filename = /path/to/logfile.log
max_bytes = 104857600
backups = 10
Log statements are currently written to a file. If the bot is deployed to a VM instance, it will eventually run out of disk space.
Ideally, logs should be treated as event streams. Also, it'd be nice to use pythons standard log library.