Questions tagged [systemd-journald]
89 questions
7
votes
3 answers
Is there a way to redirect all stdout and stderr to systemd journal from within script?
I like the idea of using systemd's journal to view and manage the logs of my own scripts. I have become aware you can log to journal from my user scripts on a per message basis..
echo 'hello' | systemd-cat -t myscript -p emerg
Is there a way to…

deanresin
- 1,466
- 2
- 16
- 31
5
votes
1 answer
Uber Zap Logger: how to prepend every log entry with a string
I am using my app as a SystemD service and need to prepend every message with an entry level for JournalD like:
<6> this is info
<7> this is debug
<4> this is warning
Otherwise, JournalD treats all the entries the same level and I want to…

IvanD
- 2,728
- 14
- 26
4
votes
2 answers
linux command to read/monitor events from systemd-journald
I want to monitor the events and logs of systemd-journal. Didn't find any commands i can use for the same. I am looking for something like 'tail -100f' which can show me the decoded events of systemd-journal

DockerNaughty
- 163
- 1
- 5
4
votes
1 answer
Out of order logs between FluentD and FluentBit
I'm currently using JournalD + JournalBeat + Logstash as logging stack but I want to switch to using JournalD + FluentD.
I tried using https://github.com/fluent-plugin-systemd/fluent-plugin-systemd as a input for FluentD but it results in a low…

Jonathan Erlich
- 41
- 3
4
votes
3 answers
Systemd service and structured logging
I have a systemd service which is of type simple.
I want my service to log key-value pairs.
Up to now my simple service just prints it log to stdout in a custom key-value syntax.
I would like to avoid my custom key-value syntax it use an official…

guettli
- 25,042
- 81
- 346
- 663
3
votes
1 answer
capture journald properties with rsyslog
I am struggling on how to capture systemd-journald properties into rsyslog files.
My setup
ubuntu inside docker on arm (raspberrypi): FROM arm64v8/ubuntu:20.04
docker command (all subsequent actions taken inside running docker container)
$ docker…

woodz
- 737
- 6
- 13
3
votes
0 answers
journalctl remove fields starting with underscore
journalctl has a --output-fields flag that allows for printing of some fields
--output-fields=
A comma separated list of the fields which should be included in the output. This has an effect only for
the output modes…

Reimundo Heluani
- 918
- 9
- 18
3
votes
1 answer
kubernetes pod logging broken with journald logging driver
Looks like journald pod logging ('kubectl logs' command) doesn't work with kubernetes v1.18.x. Is there a way to make this work with v1.18.x? I've set up a multinode cluster with docker logging driver as 'journald' (using /etc/docker/daemon.json)…

Abhay
- 129
- 2
- 11
3
votes
0 answers
Error starting docker service. "A dependency job for docker.service failed. See 'journalctl -xe' for details."
So, after some minor changes in the docker configuration I tried to restart docker and it resulted in below error message:
A dependency job for docker.service failed. See 'journalctl -xe' for details.
Kubernetes is also running on the same machine…

viveksinghggits
- 661
- 14
- 35
2
votes
0 answers
Why doesn't 'journalctl -u kubelet -f' command get all logs?
When i command
journalctl -f
I can get below logs.
Jan 20 16:28:49 node1 kubelet[1237]: I0120 16:28:49.858522 1237 scope.go:110] "RemoveContainer" containerID="6ff68682a6151eaecce82b16ca6bbc23ce44e71aedd871e5816dec1989a6ac7d"
Jan 20 16:28:49…

sun
- 93
- 5
2
votes
2 answers
journald *reading* API?
journald writes binary log files; and their format is explicitly subject to change.
The Journald Reference Guide tells us, quote:
While it can be useful to get used to journalctl to read logs, it’s by
no means mandatory.
So, how can we read these…

foo
- 1,968
- 1
- 23
- 35
2
votes
1 answer
journalctl output format without timestamp but with specific output-fields
I use journalctl and want to use an output format with which I can specify the output fields to be shown. These are for example verbose or json.
But as soon as I set these output formats, a giant UTC timestamp is automatically also added which…

regatta
- 21
- 4
2
votes
1 answer
how to make rust log into journalctl using release binary
I developed some stuff in rust and I log some errors or warnings. I 'm using systemd_journal_logger lib to do the job.
It works fine until I compile and try to use relase binary. As debug symbols are not present in it and it simply cannot log.
Is…

Vanderci Curvelo Junior
- 152
- 14
2
votes
0 answers
Journald SystemMaxUse when machine-id changes
I am using journald on an embedded system for logging to a persistant drive. The maximum stored logs are limited using the config parameter SystemMaxUse= and log rotation enabled. This works fine, until the systemd machine-id changes during software…

Martin H.
- 185
- 2
- 16
2
votes
0 answers
Redirect/forward ROS logs to journald
I have a C/C++ application which runs by ROS2 eloquent with different nodes each of which logs some information under .ros/log. My question is is there any way to redirect/forward ROS logs to journald service of Linux (so that ros log files under…

Keivan
- 1,300
- 1
- 16
- 29