Where do I find stderr logs?
22,906
Command output, i.e. stdout and stderr, is not logged anywhere by default. It goes to the terminal and when the terminal is closed, the output is gone forever.
If you want to store such output, you must redirect it to a file (or capture it into a variable and do something with it that ends with writing it to a file).
Related videos on Youtube
Author by
Daniel
Updated on September 18, 2022Comments
-
Daniel over 1 year
I was sending a message to stderr with
echo "Mayday!" 1>&2
Now I'm trying to find it in the logs but couldn't find it anywhere.
It's not in
/var/log/syslog
and neither injournalctl
,journalctl --system
norjournalctl --user
. No results even withgrep -ir "Mayday!" /var/log
Where can I find it?
-
Daniel about 6 yearsI was under the impression that everything sent to stderr was logged to syslog or journald by default. Thank you for clearing this up for me.
-
Zanna about 6 years@Daniel most welcome :)