How to get java to be logged when run from a package?
I have a java file called "Ares.jar" that runs every 5 minutes through scheduled windows tasks, batch calls:
java -jar Ares.jar >> Ares.log
I don't see the error output, is there a way to make errors (system.err.println / exception.printStackTrace ();) go to the file?
Thank.
+3
A_Elric
source
to share
1 answer
java -jar Ares.jar > Ares.log 2>&1
The second part of this command redirects stderr to stdout, ensuring that both appear in the same file.
If you want regular logs and error logs in separate files, just use:
java -jar Ares.jar > Ares.log 2>Ares.error.log
You can get full details of everything that is possible in the documentation available from Microsoft: http://technet.microsoft.com/en-us/library/bb490982.aspx
+9
JohnnyO
source
to share