If you are talking about the platform
then look at the output of "dmesg" and the contents of /var/log/syslog and /var/log/daemon.
If it is a particular program
you are interested in then run it like so:
You read pipes and redirections from right to left, so this outputs channel 2 ("stderr") into channel 1 ("stdout"); then sends stdout to the file named "file.txt"; then starts the program "myprogram".
If you want to be able to log out whilst this is running then this is the magic you need
What you need to know here is that nohup is a system program which swallows the hangup signal, allowing the myprogram to continue after you log out. nohup sends the stdout of myprogram to the file "nohup.out". So all we need to do is to redirect stderr into stdout. The final "&" starts all of this in the background.