You are not logged in.

#1 2015-01-30 20:39:08

Mister_Magotchi
Member
Registered: 2012-06-08
Posts: 13

Logging to a systemd per-user journal from shell

Does anybody know how I can log a message to a per-user journal without using a per-user systemd service (~/.config/systemd/user/something.service)?

As root, I can run:

echo This is a test. | systemd-cat -t test

or:

echo This is a test. | logger -t test

and see the logged message with:

journalctl --since='-300' -e

or:

journalctl --since='-300' -et test

As a non-root user, I can see the logs of per-user systemd services, among other things, with:

journalctl --user --since=today

I'm unable, however, to find a way to see the output of using systemd-cat or logger as a user, and when I use those commands, the timestamp of the user journal file in /var/log/journal doesn't change, so I don't think the journal is actually being written.

Any ideas?

Offline

#2 2015-02-02 22:44:04

Mister_Magotchi
Member
Registered: 2012-06-08
Posts: 13

Re: Logging to a systemd per-user journal from shell

Apparently I can do so as some users but not others.

For example:

echo This is a test. | sudo -u http systemd-cat -t test

allows me to see the entry in the journal, but:

echo This is a test. | sudo -u somenewuser systemd-cat -t test

doesn't.

Offline

Board footer

Powered by FluxBB