You only can write strings to files not exceptions. And you have to redirect stdout
and stderr
somewhere, otherwise any output will hang your program. Why don't you use nohup
? That's the normal way, to start programs without terminal.
To make this clear: There is no special behavior in HttpServer. HttpServer is writing log-information to the terminal, so you need a terminal or a redirection to a file.