FaqDeleteRotatedLogs

Skip to end of metadata
Go to start of metadata

How do I configure GlassFish to delete rotated log files?

Paraphrased from the users@glassfish mailing list:

Q. Is there a way to configure GlassFish to either only keep a certain number of rotated log files, or to delete log files after they reach a certain age? I see that you can configure rotation based on file size and age, but the log file directory still grows without bounds. (On my platform, logging to the unix syslog facility is not an option, sadly. Looking for other ideas.)

https://glassfish.dev.java.net/issues/show_bug.cgi?id=3874

A. Jan Luehe: Try setting this system property:

com.sun.enterprise.server.logging.max_history_files

which specifies the maximum number of access log files (starting with the most recent ones) to keep. GlassFish has inherited this system property from a patch developed for a customer. Preferably, this would have been defined as an <access-log property> in domain.xml, however, the <access-log> element currently does not support <property> subelements, as per the DTD that governs the domain.xml.

The com.sun.enterprise.server.logging.max_history_files system property limits the number of rotated log files for both access logging and the server log. (This means that if we wanted to make it configurable in domain.xml, we should expose it as both a property (or attribute) on <access-log> and <log-service>, with the ability to specify different values for each.)
Using admin-console, one should reach the appropriate "config/server" whose this system property needs to be set.

For asadmin, try using create-jvm-options command.


Old URL (read-only): http://wiki.glassfish.java.net/Wiki.jsp?page=FaqDeleteRotatedLogs
New Page: https://wikis.sun.com/display/glassfishwiki/FaqDeleteRotatedLogs


Old URL (read-only): http://wiki.glassfish.java.net/Wiki.jsp?page=FaqDeleteRotatedLogs
New Page: https://wikis.sun.com/display/glassfishwiki/FaqDeleteRotatedLogs

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Oracle community and they might not be employed or in any way formally affiliated with Oracle. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Oracle nor any other party necessarily agrees with them.