[Sticky] How do I view logs on Fedora?
How do I access logs and other diagnostic data? I'd like to know about both command line tools and GUI applications.
asked 2011-12-28 12:13:38 -0500
This post is a wiki. Anyone with karma >750 is welcome to improve it.
How do I access logs and other diagnostic data? I'd like to know about both command line tools and GUI applications.
answered 2011-12-28 12:28:16 -0500
This post is a wiki. Anyone with karma >750 is welcome to improve it.
logs files in fedora are stored in /var/log
ls /var/log
The Gnome Logs application (gnome-logs
) can be very useful tools to view system log files on Fedora's Gnome Desktop.
Since Fedora 20, we use journalctl
by default. Regular files such as /var/log/messages
are no longer available by default. Of course, you can install rsyslog
and journalctl
will generate them for you if you want. journalctl
itself has many many options. For example, you can filter the log based on different criteria. You can view the current or previous boot logs using the -b
flag. Here are some examples from man journalctl
(Please read the man page for more detailed information on the available options):
Without arguments, all collected logs are shown unfiltered:
journalctl
With one match specified, all entries with a field matching the expression are shown:
journalctl _SYSTEMD_UNIT=avahi-daemon.service
If two different fields are matched, only entries matching both expressions at the same time are shown:
journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097
If two matches refer to the same field, all entries matching either expression are shown:
journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service
If the separator "+" is used, two expressions may be combined in a logical OR. The following will show all messages from the Avahi service process with the PID 28097 plus all messages from the D-Bus service (from any of its processes):
journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service
Show all logs generated by the D-Bus executable:
journalctl /usr/bin/dbus-daemon
Show all logs of the kernel device node /dev/sda:
journalctl /dev/sda
Show all kernel logs from previous boot:
journalctl -k -b -1
The answer is not valid anymore as there is no /var/log/messages directory in Fedora 20. Also, could anyone supplement the answer with information on how to view a log of a recent shutdown/ troubleshoot shutdown issues? http://askubuntu.com/questions/58625/where-is-the-shutdown-log
OK... see if there are logs. ls -lrt /var/log/Xorg.*
, also check the dates. If there are files, then just cat
them.
One easy and very convenient way is to use the Gnome app gnome-logs
. It allows to filter for time periods, search within logs, display certain categories.
You are looking for the traditional text log files in /var/log, and they are gone?
Here's an explanation on what's going on:
You are running a systemd-based OS where traditional syslog has been replaced with the Journal. The journal stores the same (and more) information as classic syslog. To make use of the journal and access the collected log data simply invoke "journalctl", which will output the logs in the identical text-based format the syslog files in /var/log used to be. For further details, please refer to journalctl(1).
Alternatively, consider installing one of the traditional syslog implementations available for your distribution, which will generate the classic log files for you. Syslog implementations such as syslog-ng or rsyslog may be installed side-by-side with the journal and will continue to function the way they always did.
Thank you!
Further reading: man:journalctl(1) man:systemd-journald.service(8) man:journald.conf(5) http://0pointer.de/blog/projects/the-...
Asked: 2011-12-28 12:13:38 -0500
Seen: 105,728 times
Last updated: Apr 27 '18
[Sticky] Diference Between Java in Fedora repo Openjdk And Oracle one
[Sticky] What is Fedora Silverblue?
[Sticky] How do I UNsubscribe from a Fedora community mailing list?
[Sticky] Can I ask questions related to rawhide on Ask Fedora?
why does /var/log/journal add each NIS user
Setting up ramdrive in Fedora 20 and 24