Ouvindo alterações no journalctl

18

Normalmente, eu uso tail -f /var/log/messagespara obter atualizações se houver novas linhas.

Como ter a funcionalidade semelhante para journalctl?

Kokizzu
fonte

Respostas:

26

Você pode usar o botão -fou --followpara ajustar os logs.

-f, --follow
    Show only the most recent journal entries, and continuously print new 
    entries as they are appended to the journal.

Exemplo

$ sudo journalctl -f
-- Logs begin at Sat 2013-12-07 21:11:30 EST. --
May 14 18:16:34 somehost.somedom.com systemd[1]: Starting Fingerprint Authentication Daemon...
May 14 18:16:34 somehost.somedom.com systemd[1]: Started Fingerprint Authentication Daemon.
May 14 18:16:34 somehost.somedom.com fprintd[12553]: Launching FprintObject
May 14 18:16:34 somehost.somedom.com fprintd[12553]: ** Message: D-Bus service launched with name: net.reactivated.Fprint
May 14 18:16:34 somehost.somedom.com fprintd[12553]: ** Message: entering main loop
May 14 18:16:37 somehost.somedom.com sudo[12552]: saml : TTY=pts/2 ; PWD=/home/saml ; USER=root ; COMMAND=/bin/journalctl -f
May 14 18:16:40 somehost.somedom.com gnome-session[1787]: 18:16:40 | Listener | Trying to reconnect to tcp://notifications.sparkleshare.org:443/
May 14 18:16:44 somehost.somedom.com sudo[12582]: saml : TTY=pts/2 ; PWD=/home/saml ; USER=root ; COMMAND=/bin/journalctl -f -n 10
May 14 18:16:45 somehost.somedom.com gnome-session[1787]: 18:16:45 | Listener | Disconnected from tcp://notifications.sparkleshare.org:443/: ...d block
May 14 18:16:45 somehost.somedom.com gnome-session[1787]: 18:16:45 | personal_repo | Falling back to regular polling
May 14 18:17:04 somehost.somedom.com fprintd[12553]: ** Message: No devices in use, exit

Referências

slm
fonte
2
parece que desativa o pager, gostaria de ter tanto ...
Ben Creasy
11
@Ben Creasy $ journalctl -f - desde ontem, $ journalctl -f -n 1000
engineerX
11
journalctl --follow --no-tail --no-tailé usado quando você quer todas as linhas anteriores (melhor do que -n 100000 ou arbitrária contagem grande linha)
Olivier LAHAYE