Search code examples
pythonloggingsyslog

What are the advantages of using syslog over other logging facilites?


We are using a basic python log server based on BaseHTTPServer to aggregate our python logs on an ubunutu server. This solution has fulfilled our needs... until now. The number of programs dumping to this log server has grown and now the logger is crippling the system.

Now that we are back to the drawing board, we are considering using syslog.

Would it be advantageous to use syslog over other logging facilites.

Thanks for the help


Solution

  • Using syslog might be simple and fast, but it cannot give you full control over how your logs are aggregated.

    Your main problem now is using BaseHTTPServer, which was never meant to be used on a production server, or for anything needing high performance.

    I see two options:

    1. use a better http server with wsgi support, together with mini web framework (we are using gevent+bottle, but http://nichol.as/benchmark-of-python-web-servers is a well written comparison of solutions)
    2. use a message queue. this will mean more changes in your code but is a dedicated solution for your problem (and more efficient). (we use rabbitmq but check google or http://www.darkcoding.net/software/choosing-a-message-queue-for-python-on-ubuntu-on-a-vps for comparisons)

    Edit: A dedicated solution that supports message queues is logbook. It can also be used as direct replacement of the standard library's logging module.