[systemd-devel] Journald logging handler for Python 3 and AsyncIO integration
zbyszek at in.waw.pl
Sat May 2 07:18:29 PDT 2015
On Sat, May 02, 2015 at 03:34:52PM +0200, Ludovic Gasc wrote:
> Ok, my bad, I didn't see JournalHandler class to use with Python logging:
> Nevertheless, my question about communication between Python and journald
Can you rephrase the question? I don't quite understand what functionality
you're missing from
> Ludovic Gasc (GMLudo)
> 2015-05-02 15:12 GMT+02:00 Ludovic Gasc <gmludo at gmail.com>:
> > Hi,
> > With the new release of Debian Jessie and systemd+journald integration,
> > I'm looking for how to modernize our Python 3 toolbox to build daemons.
> > For now on Debian Wheezy, we use a SysLogHandler with UNIX socket:
> > https://docs.python.org/3.4/library/logging.handlers.html#sysloghandler
> > + a custom rsyslog+logrotate configuration to split and manage log files.
> > From sysvinit to systemd migration to start our daemons, it should be
> > easy, I've found this documentation:
> > http://gunicorn-docs.readthedocs.org/en/latest/deploy.html#systemd
> > But for journald, even if I can use syslog UNIX socket provided by
> > journald, I want to benefit the features of journald, especially structured
> > logs.
> > I've seen the Python binding for journald:
> > http://www.freedesktop.org/software/systemd/python-systemd/journal.html
> > Nevertheless, I've two questions:
> > 1. I've seen no python logging handler for journald. Is it a desired
> > situation or it's because no time to implement that ? Could you be
> > interested in by an handler with journald ?
> > 2. We use heavily AsyncIO module to have async pattern in Python,
> > especially for I/O: https://docs.python.org/3/library/asyncio.html
> > In the source code of python-systemd, I've seen that you use a C glue
> > to interact with journald, but I don't understand what's the communication
> > between my Python daemon process and journald: unix sockets ? Other
> > mechanism ? Depends on the mechanism, it should be have an impact for us.
> > Thanks for your answers.
> > Have a nice week-end.
> > --
> > Ludovic Gasc (GMLudo)
> > http://www.gmludo.eu/
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
More information about the systemd-devel