You are not logged in.

#1 2014-12-01 18:15:14

thenewguy
Member
Registered: 2013-08-13
Posts: 6

logging and journalctl

can i configure pacman to use the systemd journal instead of /var/log/pacman.log?

Offline

#2 2014-12-01 18:59:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: logging and journalctl

Why do you want to do this?

Offline

#3 2014-12-01 19:51:49

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: logging and journalctl

thenewguy wrote:

can i configure pacman to use the systemd journal instead of /var/log/pacman.log?

Not via pacman.conf. You can patch pacman to use syslog instead of a stand-alone lg file (although I don't see why this would be useful). Then journal will capture the output.

Having said that, doing so would be a bad idea because:
(1) Pacman can be run when no syslog is running, e.g. in a chroot or when you install the system.
(2) systemd journal is prone to corruption during crashes. If a system crash happens during package installation, with a plain-text pacman.log at lease you know what packages were installed, but with journald, you can reboot to a corrupted journal and then good luck recovering smile
(3) Sometimes, you'll get corrupted journals after a major systemd update. At least I get those pretty often, but it's OK since journal files are only in /run/log. Now, pacman's log has to be persistent, so having it corrupted is not an option.
(4) The log of pacman operations doesn't follow the same lifecycle as other log files. You don't want it to be rotated at the same rate as other logs.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#4 2014-12-03 05:37:58

thenewguy
Member
Registered: 2013-08-13
Posts: 6

Re: logging and journalctl

ok, you guys talked me out of it. i thought it would be convenient to have everything in one place, but sounds like i would sacrifice reliability and troubleshooting.

Offline

#5 2014-12-03 07:30:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: logging and journalctl

Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

Offline

#6 2014-12-06 00:52:01

heftig
Developer
From: Germany
Registered: 2010-04-19
Posts: 159

Re: logging and journalctl

Leonid.I wrote:
thenewguy wrote:

can i configure pacman to use the systemd journal instead of /var/log/pacman.log?

Not via pacman.conf. You can patch pacman to use syslog instead of a stand-alone lg file (although I don't see why this would be useful). Then journal will capture the output.

Having said that, doing so would be a bad idea because:
(1) Pacman can be run when no syslog is running, e.g. in a chroot or when you install the system.
(2) systemd journal is prone to corruption during crashes. If a system crash happens during package installation, with a plain-text pacman.log at lease you know what packages were installed, but with journald, you can reboot to a corrupted journal and then good luck recovering smile
(3) Sometimes, you'll get corrupted journals after a major systemd update. At least I get those pretty often, but it's OK since journal files are only in /run/log. Now, pacman's log has to be persistent, so having it corrupted is not an option.
(4) The log of pacman operations doesn't follow the same lifecycle as other log files. You don't want it to be rotated at the same rate as other logs.

Yes, via pacman.conf. Just uncomment "UseSyslog". pacman will output to syslog, but also still write pacman.log. All of those concerns are void.

Actually, I'd like to see it enabled by default.

Last edited by heftig (2014-12-06 00:52:42)

Offline

#7 2014-12-06 20:14:21

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: logging and journalctl

Ah, yes :facepalm: you are right. Apparently I haven't had a look into pacman manpage for a while... Sorry for the wrong info sad


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

Board footer

Powered by FluxBB