<div dir="ltr">Ok, my bad, I didn't see JournalHandler class to use with Python logging: <a href="http://www.freedesktop.org/software/systemd/python-systemd/journal.html#journalhandler-class">http://www.freedesktop.org/software/systemd/python-systemd/journal.html#journalhandler-class</a><div><br></div><div>Nevertheless, my question about communication between Python and journald remains.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>--<br><div style="font-size:small"><div>Ludovic Gasc (GMLudo)</div></div><div style="font-size:small"><a href="http://www.gmludo.eu/" target="_blank">http://www.gmludo.eu/</a></div></div></div></div></div>
<br><div class="gmail_quote">2015-05-02 15:12 GMT+02:00 Ludovic Gasc <span dir="ltr"><<a href="mailto:gmludo@gmail.com" target="_blank">gmludo@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>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.</div><div><br></div><div>For now on Debian Wheezy, we use a SysLogHandler with UNIX socket: <a href="https://docs.python.org/3.4/library/logging.handlers.html#sysloghandler" target="_blank">https://docs.python.org/3.4/library/logging.handlers.html#sysloghandler</a></div><div>+ a custom rsyslog+logrotate configuration to split and manage log files.</div><div><br></div><div>From sysvinit to systemd migration to start our daemons, it should be easy, I've found this documentation: <a href="http://gunicorn-docs.readthedocs.org/en/latest/deploy.html#systemd" target="_blank">http://gunicorn-docs.readthedocs.org/en/latest/deploy.html#systemd</a></div><div><br></div><div>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.</div><div><br></div><div>I've seen the Python binding for journald: <a href="http://www.freedesktop.org/software/systemd/python-systemd/journal.html" target="_blank">http://www.freedesktop.org/software/systemd/python-systemd/journal.html</a></div><div>Nevertheless, I've two questions:</div><div><ol><li>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 ?</li><li>We use heavily AsyncIO module to have async pattern in Python, especially for I/O: <a href="https://docs.python.org/3/library/asyncio.html" target="_blank">https://docs.python.org/3/library/asyncio.html</a><br>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.</li></ol><div>Thanks for your answers.</div></div><div><br></div><div>Have a nice week-end.</div><div><div><div><div dir="ltr"><div>--<br><div style="font-size:small"><div>Ludovic Gasc (GMLudo)</div></div><div style="font-size:small"><a href="http://www.gmludo.eu/" target="_blank">http://www.gmludo.eu/</a></div></div></div></div></div>
</div></div>
</blockquote></div><br></div>