You are not logged in.
Hi all, how would I go about logging to syslog (systemd-journald) but for my own user? For example, a simple python program logs as follows:
import syslog
syslog.openlog('my_program')
syslog.syslog('hello, syslog')
But when I run journalctl -xn as a normal user, I don't see the log message. I only see it when I run journalctl -xn as root. As stated by the systemd documentation, journalctl only displays your own user's logs when run as a regular user, so it appears that the python program is logging to the system log instead of my own user's logs. How would I go about logging to my own user's journal?
Last edited by solarwind (2014-07-29 00:54:17)
Offline
http://www.freedesktop.org/software/sys … alctl.html
All users are granted access to their private per-user journals. However, by default, only root and users who are members of the "systemd-journal" group get access to the system journal and the journals of other users.
and
--user
However, I seem to be able to read the log no matter what. I tested it on the RaspberryPi, maybe the image has some unwanted settings.
Offline
This may be a limitation of the syslog API? You'll need to check the docs. You may get better responses in the systemd mailing list or IRC channel.
Offline
Update: This wasn't working because I had the noacl option on for my root partition (where the journal is stored). Apparently the systemd journal requires ACLs for the permissions to work properly for user's journals.
Everything is working as expected now.
Last edited by solarwind (2014-07-30 03:14:46)
Offline