I wanted to know like where does the stderr dumps its content. I have a question like whether it dumps to syslog? Please explain.
5 Answers
stderr
is just another output stream, just like stdout
.
Where it's hooked up depends on how the application is called.
For example if I run foo.exe 2> errors.txt
then stderr
will write to the specified file.

- 70,399
- 25
- 169
- 233
Stderr output is dumped whenever you decide to redirect it.
If you run a program in a GUI enviroment, by clicking on an icon or something, look for .xsession-errors
in your $HOME
.
If you run a program from a shell and don't redirect stderr, you just see it on your terminal (and it is not saved anywhere else).

- 20,999
- 2
- 37
- 69
That depends on the environment.
By default, stderr is typically connected to the same place as stdout, i.e. the current terminal.
Otherwise, you wouldn't see the errors which would be kind of annoying.
Here is a blog post about redirecting stderr to the system's logging mechanism.

- 391,730
- 64
- 469
- 606
stderr
is a stream. It's managed by and output to by the owning process. Where it 'goes' is defined by how the process is invoked. The parent process can gather it and write it to a file, ignore it, redirect it to /dev/null
(esssentially binning it) etc.

- 268,207
- 37
- 334
- 440
Whilst stderr
can be redirected elsewhere, it typically outputs to the same place as stdout
. To make it into syslog, you'd definitely have to work a bit. This link:
With bash, how can I pipe standard error into another process?
shows how you pipe stderr to a pipe, and if the other process is a process that writes to "syslog", it would do what you want. But for most cases, it's probably easier to just add syslog functionality to your own program.

- 1
- 1

- 126,704
- 14
- 140
- 227