Can’t redirect STDERR or STDOUT to file

gnu-screenstderrstdout

I have application written in Go language and it runs in screen
(I do not think problem relates to Go language. I believe it uses STDOUT and STDERR)

screen -S log_server -d -m go run log_server.go 2 > err3.txt 1 > std3.txt

When it crashes I get error written in screen not in err3.txt or std3.txt

screen does not scroll and does not allow me to read full error.

std3.txt works properly
err3.txt has size 0 and error is printed in screen (I can see last 20 or 30 lines)
App crashes once per 3 or 5 days.

Best Answer

Not all spaces are permissible. Try instead

screen -S log_server -d -m go run log_server.go 2> err3.txt 1> std3.txt