Lennart's Lemmings: Disable systemd binary logs
Posted: Mon Jun 09, 2014 10:37 am
This recipe assumes you're using systemd; more information:
http://linuxbbq.org/bbs/viewtopic.php?f=19&t=1246
Journald:
- It logs Everything and his mother (Linus's thoughts)
- Stores logs in binary format (Lord Lennart's Lithurgy)
Here we'll address both, while keeping systemd.
Install the regular syslog service:
Configs:
Disable the persistent journal:
Enable syslog-ng:
Now you should see a socket, where journalctl redirects output to syslog:
Check it's all working:
This leaves the volatile journal, which logs stuff not passed to syslog:
Logging can be limited further:
Experience reports welcome. :D
http://linuxbbq.org/bbs/viewtopic.php?f=19&t=1246
Journald:
- It logs Everything and his mother (Linus's thoughts)
- Stores logs in binary format (Lord Lennart's Lithurgy)
Here we'll address both, while keeping systemd.
Install the regular syslog service:
Code: Select all
# apt-get install syslog-ng logrotate
Code: Select all
/etc/syslog-ng/syslog-ng.conf
------
source src {
system();
internal();
};
Code: Select all
# rm -rf /var/log/journal
Code: Select all
# systemctl enable syslog-ng
# systemctl start syslog-ng
Code: Select all
$ ls -l /run/systemd/journal
srw-rw-rw- 1 root root 0 Jun 9 04:54 syslog
Code: Select all
# cat /var/log/messages.log
Jun 9 04:54:12 localhost systemd[1]: Listening on Syslog Socket.
Jun 9 04:54:12 localhost systemd[1]: Starting System Logger Daemon...
Jun 9 04:54:12 localhost systemd[1]: Started System Logger Daemon.
Note: this affects the journalctl and systemctl commands.man journald.conf wrote:Storage=
"none" turns off all storage, all log data received will be dropped. Forwarding to other targets, such as the console, the kernel log buffer or a syslog daemon will still work however. Defaults to "auto".
Code: Select all
/etc/journald.conf
------
Storage=none
For example:man journald.conf wrote:By default, only forwarding to syslog and wall is enabled. (...) MaxLevelStore=, MaxLevelSyslog=, MaxLevelKMsg=, MaxLevelConsole=, MaxLevelWall=
As argument, takes one of "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug" or integer values in the range of 0..7 (corresponding to the same levels). Messages equal or below the log level specified are stored/forwarded, messages above are dropped.
Code: Select all
/etc/journald.conf
------
MaxLevelSyslog=info