A Python logging broadcast handler
I have implemented a handler for the Python logging system called broadcast-logging which sends out the log messages via UDP broadcasts. This might be useful in case you want to sporadically listen to certain log messages, e.g. from a server, without setting up a special service for this purpose. Since broadcasts are sent via UDP and no explicit connections are set up, this might also be useful in case you want to debug TCP-connection-related issues while preventing artificial connections for the debugging session.
After installing the Python package, you can use the provided logging handler by configuring the logging system appropriately, e.g. via a config file like the following one:
[loggers] keys=root [handlers] keys=broadcastHandler [formatters] keys=simpleFormatter [logger_root] level=DEBUG handlers=broadcastHandler [handler_broadcastHandler] class=broadcastlogging.BroadcastHandler level=DEBUG args=('192.168.0.255',55555)
In order to receive the logging messages, the
broadcastlogging module also provides an executable which replicates the log messages in a local program. It can be launched e.g. as follows:
python -m broadcastlogging -h -c -b '192.168.0.255' 55555
For further details, please refer to the online help of the module and the README file.
The broadcast-logging package is available on my GitHub account and on PyPI. Feel free to try this out and please give feedback via GitHub issues in case of problems or enhancement ideas.