Thursday, February 16, 2017

Console/Command prompt output and error log write to a specific file

Output and error log write to a specific file.

 '>' will overwrite the file, '>>' will append to the file

Overwriting and appending output file
======================================

'>'  : for overwriting output file.
'>>' : for appending to the same logfile.



Overwriting and appending error log file
========================================

'2>' : for overwriting error log file.
'2>>': for appending to the same error logfile


java -jar test.jar > output.log

java -jar test.jar >> output.log

java -jar test.jar 2> error.log

java -jar test.jar 2>> error.log

No comments:

Post a Comment