Questions tagged [journalctl]

50 questions
50
votes
2 answers

How do view older journalctl logs (after a rotation maybe?)

I am running docker on ubuntu 16.04 and would like to view the logs. However, I am unable to view logs after what I am guessing is some sort of rotation or the logs grow to a certain size. I have not made any changes to my journald.conf, so I am…
jdf
  • 821
  • 1
  • 7
  • 9
39
votes
2 answers

How to allow a user to use journalctl to see user-specific systemd service logs?

I am running user-level services in Ubuntu 16.04 LTS. For example, I have my test.service located at ~/.config/systemd/user/test.service. I was able to run the service by doing systemctl --user start test.target However, when I try to read its log…
ChromeHearts
  • 510
  • 1
  • 4
  • 8
28
votes
6 answers

Is there a way to make journalctl show logs from "the last time foo.service ran"?

I'm particularly interested in this for looking at the output of oneshot services that run on a timer. The --unit flag is close, but it concatenates all the runs of the service together. The most obvious way I can think of would be to filter on PID,…
Jack O'Connor
  • 591
  • 1
  • 6
  • 9
24
votes
6 answers

journalctl: how to display colors in its output?

The output of journalctl really looks messy without colors. Is it possible to add colors to its output? On my system it seems only important lines are highlighted. Even dmesg can output with color by adding the --color switch!
xuhdev
  • 800
  • 2
  • 6
  • 19
17
votes
2 answers

journalctl access for non-root users

The journald documentation says that adding a user to 'systemd-journal' group or 'adm' group allows the user to access system-wide journal. I'm running the latest CentOS 7 and I seem to have problem accessing the journal as a non-root user. Here's…
mike
  • 221
  • 1
  • 4
  • 12
14
votes
3 answers

systemd's journalctl: how to filter by message?

journalctl looks like a great tool for looking through logs, but I'm stuck on what feels like a simple ask: I want to see all cron messages that contain the phrase update-ipsets. Of course I can do this journalctl -u cron.service | grep…
artfulrobot
  • 2,627
  • 11
  • 30
  • 56
12
votes
1 answer

How to display syslog priority level in systemd's journalctl

journalctl allows me to filter on priority (-p) and color-codes the priority in the output. But is there any way to get it to output the priority directly, as text?
Avi Kivity
  • 223
  • 2
  • 6
8
votes
1 answer

View unbuffered log output from journalctl

I have several systemd services defined. They log both to disk and also to the systemd journal, which I can monitor using journalctl -n 0 -fu myservice. However, I notice that the logs that I see from the journalctl tail command are often several…
amoe
  • 185
  • 1
  • 9
7
votes
2 answers

Journalctl and syslog: How does it actually work?

I'm having a hard time understanding how logging works on linux. Since the inclusion of systemd, it seems a bit easier, but I still have a couple of concepts that still can't fully understand. Given a system with journalctl, I want to send some log…
RedNano
  • 313
  • 1
  • 5
  • 10
7
votes
3 answers

systemd-journald Doesn't start at all

After deleting my /var/log/journal by accident, I am unable to recover from the consequences. systemd-journald keeps failing over and over again every time I try to start it. when I run: $ journalctl --verify PASS:…
lyoko the
  • 231
  • 1
  • 2
  • 6
7
votes
1 answer

How can I output logs to a file from the content of a service with systemd

Well, I have a service configured with systemctl. This is the config file: [Unit] Description=The description of the service (: After=network.target [Service] ExecStartPre=/bin/echo 'Starting Service' >>…
robe007
  • 203
  • 1
  • 2
  • 9
6
votes
1 answer

How to filter journalctl output by process name?

When a process logs to systemd, its process name is recorded and displayed as identifier in the journalctl output. $ systemd-cat echo "test" $ journalctl -f -- Logs begin at Sat 2018-02-24 12:13:24 CET. -- ... Jul 25 13:52:26 mycomputer echo[25098]:…
Merlijn Sebrechts
  • 369
  • 1
  • 4
  • 14
5
votes
5 answers

reliable export of journalctl logs

I search a way for a reliable export of journalctl logs. I could use the --since=... option, but this is a bit fuzzy. In my case a script would call journalctl --output=json every ten minutes. I don't want to miss a single line and (if possible) I…
guettli
  • 3,113
  • 14
  • 59
  • 110
4
votes
1 answer

View auditd logs in journalctl

I'm using CentOS 7. trying to view auditd logs in journalctl When I try journalctl -u auditd I see the following output: -- Logs begin at Wed 2018-09-05 08:59:19 EDT, end at Wed 2018-09-19 15:01:01 EDT. -- Sep 05 12:59:25 centos7 systemd[1]:…
kenlukas
  • 2,886
  • 2
  • 14
  • 25
4
votes
2 answers

No error message in journactl of custom service

I try to write a custom service file. Unfortunately I see no output in the journalctl. Here is my unit file: root@om:~# cat /etc/systemd/system/ssh-tunnel-foo-de.service [Unit] Description=Tunnel For…
guettli
  • 3,113
  • 14
  • 59
  • 110
1
2 3 4