I wrote a websocket server with go, running on Debian. Now I have a very long panic message and I want to write it to a file
./server > err
writes only the normal output. Error messages still appear on stdout.
How can I redirect them?
I wrote a websocket server with go, running on Debian. Now I have a very long panic message and I want to write it to a file
./server > err
writes only the normal output. Error messages still appear on stdout.
How can I redirect them?
Error message are sent to stderr
, so you have to redirect that as well to a file.
Start your server with:
./server > err 2>&1