Post date: Sep 18, 2018 6:19:47 AM
In Glassfish we have provision to change the number of retained server log files by changing the Maximum History files value.
The behavior of the Maximum History files is as follows:
1. If the property is set to 0, Oracle GlassFish Server retains all rotated log files (that is, no sets no maximum).
2. If the property is not set, Oracle GlassFish Server keeps a maximum of 10 rotated log files.
3. If the property is set to an invalid number or null, Oracle GlassFish Server keeps a maximum of 10 rotated log files.
Please find the below steps to set the Maximum History files value
a. Log in to the Glassfish server admin console with the valid credentials for a particular instance.
b. Navigate to server-config-->Logger Settings
c. Change the Maximum History Files value to some other number (depends on how many server log file needs to be retained ) as the value zero will keep all the log files.
d. Save the configuration.
e. Restart the Glassfish server to reflect the changes.
Advantage:-
By using this Maximum History Files configuration, we can set the number of log files to be retained in the server log path and we can avoid unnecessary space consumption in the server.