You are not logged in.
Hi,
I am trying to add logging functionality to a python app.
The app is intended to be run as a non-root user. Where should the logs be stored?
/var/log is owned by root, and thus cannot write in it as normal user.
What other locations can be used to save logs for non-root user?
Thank you!
Last edited by kryptxy (2017-09-03 06:34:12)
Offline
XDG_DATA_HOME would be appropriate. For example Xorg uses it for rootless session's log files.
And/or you could write directly to systemd journal. Should be quite simple with python-systemd.
There's also 'systemd-cat' if someone's looking for this functionality for e.g. a bash script.
Last edited by ooo (2017-09-03 07:12:57)
Offline
Thanks! I'd go with XDG_DATA_HOME.
Offline