-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently we use default logging to file in Python. In most cases, because the logging calls aren't overlapping, it seems to be fine that multiple different processes are accessing the same file. This is not always the case though, and we do occasionally get error messages. We should eventually switch to a process-safe logger, perhaps using sockets. These resources might be helpful:
- https://stackoverflow.com/questions/641420/how-should-i-log-while-using-multiprocessing-in-python
- https://superfastpython.com/multiprocessing-logging-in-python/#3_Use_Custom_Process-Safe_Logging_recommended
- https://docs.python.org/3/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes
- https://docs.python.org/3/library/logging.html
- https://docs.python.org/3/library/multiprocessing.html#logging
- https://docs.python.org/3/library/logging.handlers.html#logging.handlers.QueueHandler
- https://stackoverflow.com/a/642221/11530613
- https://stackoverflow.com/a/24791689/11530613
- https://docs.python.org/3/library/logging.handlers.html#sockethandler
- https://docs.python.org/3/howto/logging-cookbook.html#sending-and-receiving-logging-events-across-a-network
- https://code.activestate.com/recipes/577025-loggingwebmonitor-a-central-logging-server-and-mon/
Some examples:
- https://gist.github.com/schlamar/7003737
- https://gist.github.com/vsajip/4b227eeec43817465ca835ca66f75e2b
Potentially, the CLI doesn't need to do any logging, or any direct usage of the program doesn't use multiprocessing logging, only things being run and managed by the daemon? Then you have two different kinds of logs?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request