Visualizando registros en Fedora
Los archivos de registro contienen mensajes sobre el sistema, incluyendo el kernel, los servicios y las aplicaciones que están corriendo. Contienen información que ayuda en la resolución de problemas o simplemente monitorizan funciones del sistema. Fedora utiliza el administrador de sistema y servicios systemd. Con systemd, los mensajes de la mayoría de los servicios se almacenan ahora en un diario systemd que es un archivo binario al que se debe acceder usando el comando journalctl
.
Las herramientas del sistema que no usan systemd para sus registros continúan poniéndolos como texto plano en el directorio /var/log/
. En Fedora, hay dos maneras de acceder a las bitácoras del sistema:
-
La línea de instrucción
-
Un IGU de aplicaciones
Utilizar la línea de instrucción para ver archivos de bitácora
La instrucción journalctl
pueden ser utilizadas para ver mensajes dentro del diario del sistema en la línea de instrucción. Para archivos de texto sin formato, puede utilizarse herramientas genéricas:
-
cat
,more
,less
,tail
, ohead
. -
la instrucción
grep
para buscar información específica. -
any text editor of your choosing (nano/pico/vim/emacs)
Please note that you may require sudo
access to view these files.
Using journalctl to view system information
-
To view all collected journal entries, simply use:
journalctl
-
To view a logs related to a specific file, you can provide the
journalctl
command with a filepath. The example shown below shows all logs of the kernel device node/dev/sda
:
$ journalctl /dev/sda
-
To view log for the current boot use the
-b
option :
$ journalctl -b
-
To view kernel logs for the previous boot, you can add the
-k
option:
$ journalctl -k -b -1
Using journalctl to view log information for a specific service
-
To filter logs to only see ones matching the "foo" systemd service:
$ journalctl -b _SYSTEMD_UNIT=foo
-
Matches can be combined. For example, to view logs for systemd-units that match
foo
, and the PIDnumber
:
$ journalctl -b _SYSTEMD_UNIT=foo _PID=number
-
If the separator "+" is used, two expressions may be combined in a logical OR. For example, to view all messages from the
foo
service process with thePID
plus all messages from thefoo1
service (from any of its processes):
$ journalctl -b _SYSTEMD_UNIT=foo _PID=number + _SYSTEMD_UNIT=foo1
-
If two matches refer to the same field, all entries matching either expression are shown. For example, this command will show logs matching a systemd-unit
foo
or a systemd-unitfoo1
:
$ journalctl -b _SYSTEMD_UNIT=foo _SYSTEMD_UNIT=foo1
The files for service modification are stored in a directory within /etc/systemd/system , to know more about systemd, please refer to understanding-and-administering-systemd.adoc#Understanding Systemd Services
|
Using journalctl to view older logs
-
To view older logs use the
--list-boots
option :
This will show a tabular list of boot numbers, their IDs, and the timestamps of the first and last message pertaining to the boot:
$ journalctl --list-boots -8 42cdeac65d494e938b9cb92f315b08a4 Mon 2018-11-12 10:36:42 CET—Mon 2018-11-12 20:08:24 CET -7 c110d2b8705345b786fe310de628bfc7 Tue 2018-11-13 10:29:27 CET—Tue 2018-11-13 10:04:00 CET
with this ID you can use journalctl
as usual :
$ journalctl --boot=ID _SYSTEMD_UNIT=foo
-
To know more about
journalctl
, read the man page:
$ man journalctl
Utilizando Bitácoras de Gnome para verlos archivos de bitácoras (log)
La aplicación GNOME Logs
proporciona una herramienta con IGU conveniente para ver el diario de systemd. GNOME Logs
no es instalado por defecto actualmente en los sistemas de Fedora.
-
Puede instalar
Gnome Logs
con la aplicación de instalación de software predeterminada de su sistema. En una instalación de Fedora Workstation con el escritorio GNOME:-
Presione la tecla
Super
-
Teclee
Software
-
In the
Search
field typeLogs
and choose theGNOME Logs
item from the list of results -
Install the application
-
-
You can also install
GNOME Logs
using the command line withdnf
:
$ sudo dnf install gnome-logs
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
Log
, 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.
-
Want to help? Learn how to contribute to Fedora Docs ›