Questions tagged [journalctl]

Questions about journalctl - the tool used to manage, query and view logs on systemd setups.

145 questions
111
votes
5 answers

How to see the latest x lines from systemctl service log

I'm looking for a way, to simply print the last X lines from a systemctl service in Debian. I would like to install this code into a script, which uses the printed and latest log entries. I've found this post but I wasn't able to modify it for my…
user3191334
  • 1,379
  • 2
  • 9
  • 11
85
votes
5 answers

Combining tail && journalctl

I'm tailing logs of my own app and postgres. tail -f /tmp/myapp.log /var/log/postgresql/postgresql.main.log I need to include pgpool's logs. It used to be syslog but now it is in journalctl. Is there a way to tie tail -f && journalctl -f together?
bikey
  • 851
  • 1
  • 6
  • 4
31
votes
1 answer

What is the difference between dmesg and journalctl

I am completely new to Linux. I know that dmesg and journalctl record commands invoked by my operating-system, but why do 2 recorders exist, what types of messages should I expect to see within each of them, and what are the differences in their…
Rimski
  • 433
  • 1
  • 4
  • 7
29
votes
2 answers

How do you go to the end of the file in journalctl?

If I type sudo journalctl I get the system journal in some kind of a reader. Pressing j and k works like in Vi but G does not go to the end of the file. In fact, if press G, the stream freezes and I have forcibly terminate it. No mention of using…
Tyler Durden
  • 5,411
  • 16
  • 57
  • 96
27
votes
2 answers

How to watch output from systemd service?

I want to watch output from a systemd service on CentOS as if I have started this service from console. Yes, I can see output with journalctl, but it doesn't scroll to the bottom automatically. So how can I watch live output from service?
stiv
  • 1,451
  • 5
  • 22
  • 32
19
votes
1 answer

Why does journalctl say "-- no entries --"?

For example: ┌─[10:50:38/hypership/root/~] └─╼ journalctl -b No journal files were found. -- No entries -- ┌─[10:50:46/hypership/root/~] └─╼ journalctl --verify No journal files were found. /var/log is full of files though, and this was working…
trusktr
  • 4,035
  • 7
  • 29
  • 34
13
votes
2 answers

Remove single line from journalctl file

I have an Ubuntu 18.04 server that is running a service I'm developing. The output is being sent to the system journal for logging. I accidentally failed to sanitize some logging and a plaintext password (for my own user) was accidentally leaked in…
Ashoat
  • 231
  • 1
  • 4
11
votes
2 answers

Where to find the log file of specific service

Using sudo journalctl -u {service} I can see the log of specific service. How to find the associated log file? What is the best way to monitor a log file programmatically? (I mean a program the react based on something appears in the log file)
pouya
  • 213
  • 1
  • 2
  • 6
10
votes
2 answers

Arch linux randomly freezes after updating to kernel 5.10

last three days I am experiencing random freezes. If i am looking on youtube when this happens Audio keeps playing but screen is froze and keyboard or cursor do not do anything. I trying to look in sudo journalctl and this is what I found: led 04…
Jan Černý
  • 1,185
  • 2
  • 24
  • 46
10
votes
2 answers

How to configure journald to discard entries older than a certain time span

From the documentation I know that I can configure the time after which journal files are deleted via MaxRetentionSec. the time after which journal files are rotated via MaxFileSec. However my goal is to configure journald in a way such that all…
Richard Neumann
  • 1,309
  • 1
  • 14
  • 22
9
votes
1 answer

Getting systemd service logs faster from my service

I'm having a systemd service defined as follows, that works fine: [Unit] Description=my…
adamczi
  • 251
  • 2
  • 8
9
votes
2 answers

Print only timestamp and message in journalctl

I'm trying to get the last few lines from journalctl so I can feed them into my conky. However journalctl by default provides too much crap that wastes space: With journalctl -u PROCESS -n 5 --no-pager -l I get entries like: DATE TIME HOSTNAME…
Bagalaw
  • 835
  • 2
  • 9
  • 24
8
votes
2 answers

Show journal logs from the time a service was restarted

Is there a canonical way to get all the logs from journalctl since a service was last restarted? What I want to do is restart a service and immediately see all the logs since I initiated the restart. I came up with: $ unit=prometheus $ sudo…
sdht0
  • 183
  • 4
8
votes
1 answer

gnome-shell error log

Where can I find gnome-shell error (or debug) log? I'm interested in mutter error/warning messages since I have a GLX problem I need to debug and I believe the key could be in gnome-shell's messages.
Dean
  • 384
  • 1
  • 4
  • 11
8
votes
1 answer

How does journalctl sign the logs if the "The verification key should be stored externally."?

$ man journalctl ... --setup-keys Instead of showing journal contents, generate a new key pair for Forward Secure Sealing (FSS). This will generate a sealing key and a verification key. The sealing key is stored in the journal data directory and…
Marina Ala
  • 371
  • 3
  • 5
  • 16
1
2 3
9 10