Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to append gc log

below is gc logging option to write the specific file

-verbose:gc
-Xloggc:/logs/gc.log

OK. Good. but when java app is restarted, old gc log contents in the file disappeared. I hope vm to append gc log to "/logs/gc.log" file.

does option for this exist? or i have to write shell script to back up old gc file?

like image 550
uuidcode Avatar asked Jul 04 '11 04:07

uuidcode


1 Answers

You are explicitly requesting that the gc data goes to a file named 'gc.log'. You can append the date & pid to the filename to prevent this sort of collision. No mechanism within Hotspot exists to prevent the data from being overwritten.

like image 156
Amir Afghani Avatar answered Sep 21 '22 19:09

Amir Afghani