Viewing logs (joflynn)

This commit is contained in:
Mirek Jahoda 2018-07-10 16:49:26 +02:00
parent 4703a46560
commit 1491fcf161
4 changed files with 93 additions and 0 deletions

View file

@ -0,0 +1,27 @@
[id='viewing-logs']
= Viewing logs
Log files contain messages about the system, including the kernel, services, and applications running on it. There are different log files for different information. For example, there is a default system log file, a log file for security messages, and a log file for cron tasks.
[id='locating-log-files']
== Locating log files
Most log files are located in the `/var/log/` directory.
`Rsyslog` is a system utility that provides support for logging. To install the _rsyslog_ package:
----
$ sudo dnf install rsyslog
----
To view a list of log files maintained by the related daemon, `rsyslogd`, enter the following command:
----
$ less /etc/rsyslog.conf
----
[id='viewing-log-files']
== Viewing log files
In Fedora, there are two ways to open the log files:
* The command line
* A GUI application

View file

@ -0,0 +1,13 @@
[id='using-GUI-to-view-log-files']
=== Using GUI to view log files
To view log files in GUI, use the `GNOME Logs` application. `GNOME Logs` is not installed by default, press the `Super` key and type `Software`. In the `Search` field type `Logs` and choose the `GNOME Logs` item from the list of results and install the application.
In `GNOME Logs`, you can filter for time periods, search within logs, and display categories.
* To select a log file type, from the side bar of GNOME Logs, select the type to view.
* To select a time period, from the menu bar, click *Logs*, and select a time period.
* To search within logs, select a log file from the results pane.
. Click the search icon.
. Enter one or more search criterion in the search field.

View file

@ -0,0 +1,45 @@
[id='using-the-command-line-to-view-log-files]
=== Using the command line to view log files
You can use the command line to view logs in different ways, for example:
* Using the *journalctl* command
* Using the commands for viewing, for example *cat*, *more*, *less*, *tail*, or *head*
* Combine the commands for viewing with the *grep* command
* Using a text editor, for example, `nano` or `vim`
[id='using-journalctl-to-view-system-information']
==== Using journalctl to view system information.
* To view all collected logs with no filter:
----
$ journalctl
----
* To view a specific log file, enter the *journalctl* command with a log filepath. The example command returns all logs of the kernel device node `/dev/sda`:
----
$ journalctl /dev/sda
----
* To view the boot logs, run the following command:
----
$ journalctl -k -b -1
----
* For more information on *journalctl*, read the man page:
----
$ man journalctl
----
[id='using-the-command-line-to-open-log-files-in-text-editor']
==== Using the command line to open log files in a text editor
All log files are in plain text. To open a log file in a text editor, enter the following command:
----
$ nano <logfilename>
----
If the root permissions are required:
----
$ sudo nano <logfilename>
----

8
en-US/viewing-logs.adoc Normal file
View file

@ -0,0 +1,8 @@
:md: ./modules
include::{md}/con_viewing-logs.adoc[leveloffset=+1]
include::{md}/proc_log-files-command-line.adoc[leveloffset=+1]
include::{md}/proc_log-files-GUI.adoc[leveloffset=+1]