How to let output and message be print to two separate external files? Also, I'd like the content print out to have similar look as when it's print inside the notebook, i.e. it should be in OutputForm or whatever proper form.
Sounds like you are looking for
$Output, and maybe also
$Output are a list of streams to which corresponding output is written (note that
$Output is only getting output from
$Post so it will also write to the desired output file.
You can open a file for each with
OpenWrite and append the resulting streams to the two lists and the messages and output will be written to those files. You can use the option
OpenWrite to write to those files in
OutputForm. But since these are text files the outcome is not very useful in my opinion: For lengthy expressions the multiline ASCII art is usually harder to read than input form and these files will not be readable for any program. So I'd rather stick with the default
For return values of shift-return-evaluations you could use something like:
$PrePrint = Function[Write[outstream,#];#]
where outstream is the open stream to your output file.