how to append gc log

冷暖自知 提交于 2020-01-12 22:11:11

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/6567379/how-to-append-gc-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!