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).

Share:
22,906

Related videos on Youtube

Daniel
Author by

Daniel

Updated on September 18, 2022

Comments

  • Daniel
    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 in journalctl, journalctl --system nor journalctl --user. No results even with grep -ir "Mayday!" /var/log

    Where can I find it?

  • Daniel
    Daniel about 6 years
    I 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
    Zanna about 6 years
    @Daniel most welcome :)