Is there a way to enable the kernel log?


I’m quite new to Opensuse Tumbleweed, I used Linux Mint before, and in Mint there was a /var/log/kern.log with kernel and (error) messages. I can’t find it in Tumbleweed. Is there a way to enable the log, or is the kernel compiled in a way that disables it completely?

(Context: I’d like to check for certain error messages after a system freeze that I suspect to be caused by the nvidia driver. I had a similar problem in Mint with the 4.55 driver, and although it is allegedly fixed in the 4.60 beta, I have similar freezes in games now, that didn’t happen with the 4.50 driver in Linux Mint. Therefore it would be helpful if I were able to check the kern.log.)

Thanks for any tips!

dmesg is pretty standard for that.

$ dmesg

Checkout what it does with

$ man dmesg

Hey that’s great! I wasn’t aware of that!


There is also journalctl -b as well as many other iterations of the journalctl command for extracting different information…

Thanks malcolm, that willl be helpful, too. For now I will try to log what’s happening next try I play a game with dmesg -T --follow > ~/.dmesg.log and hope that it gives more insight into the problem.

If rsyslog is active, then /var/log/messages will contain kernel logging…

systemctl status rsyslog

For reference…

# ls -l /var/log/messages*
-rw-r----- 1 root root 2078558 Jan 15 19:48 /var/log/messages
-rw-r----- 1 root root  359836 Oct 11 09:01 /var/log/messages-20201011.xz
-rw-r----- 1 root root  436412 Oct 23 09:05 /var/log/messages-20201023.xz
-rw-r----- 1 root root  297996 Oct 29 10:34 /var/log/messages-20201029.xz
-rw-r----- 1 root root  381544 Nov  6 05:40 /var/log/messages-20201106.xz
-rw-r----- 1 root root  331660 Nov 16 06:27 /var/log/messages-20201116.xz
-rw-r----- 1 root root  289896 Nov 24 06:50 /var/log/messages-20201124.xz
-rw-r----- 1 root root  298232 Nov 27 06:14 /var/log/messages-20201127.xz
-rw-r----- 1 root root  295180 Dec  8 05:31 /var/log/messages-20201208.xz
-rw-r----- 1 root root  299696 Dec 19 08:35 /var/log/messages-20201219.xz
-rw-r----- 1 root root  353308 Dec 23 09:06 /var/log/messages-20201223.xz
-rw-r----- 1 root root  331176 Jan  3 09:18 /var/log/messages-20210103.xz

FWIW, an old thread on the subject…

rsyslog sounds good. I’d like to have the kernel messages saved in textform.

 ~ > systemctl status rsyslog
Unit rsyslog.service could not be found.

But it’s not installed per default and when I try to install it, zypper tells me:

Problem: systemd-logger-246.9-1.1.x86_64 conflicts with namespace:otherproviders(syslog) provided by rsyslog-8.2012.0-1.1.x86_64
 Solution 1: deinstallation of systemd-logger-246.9-1.1.x86_64
 Solution 2: do not install rsyslog-8.2012.0-1.1.x86_64

Is it ‘safe’ to replace the systemd-logger, or will this have unwanted side effects?

After reading a bit about it: making rsyslog work with systemd seems to be a bit too involved for my use case. I’ll first try to log with dmesg, and if that doesn’t work, I’ll take another look at rsyslog. In any case: thanks for the suggestion!

Why not using journalctl as posted by malcolmlewis?

I generally only use the systemd journal, but I recall adding rsyslog a long time back to assist a user having issues. I had no problem running the two services concurrently. The systemd-journal forward logs to syslog (enabled by default in journald configuration). I’m using openSUSE Leap 15.2, and not sure if there are differences with TW.