Turn off Glassfish Log Rotation

坚强是说给别人听的谎言 提交于 2019-12-10 11:40:48

问题


I know that it is possible to configure log rotation options based on file size. I could not find and option to turn off the rotation rules completely at Glassfish 3.1?

Is it possible to disable log rotation at Glassfish 3.1?


回答1:


You can turn off log rotation by setting the File Rotation Limit (server-config -> Logger Settings) to 0 bytes in the glassfish admin gui or via asadmin command:

asadmin set-log-attributes --target server
com.sun.enterprise.server.logging.GFFileHandler.rotationLimitInBytes=0



回答2:


When I try to set a 0 bytes limit in the admin GUI (GF 4.1), I get this error:

Invalid logging attribute name or value com.sun.enterprise.server.logging.GFFileHandler.rotationLimitInBytes=0.

This seems to be consistent with this thread, which also suggests to modify the value directly in logging.properties instead. Doing that worked for me and disabled log rotation.



来源:https://stackoverflow.com/questions/14152905/turn-off-glassfish-log-rotation

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