0


I am using Glassfish 4. I would like to rotate the log every day. That means I like a new log for each day. I have tried changing properties at the admin console at http:localhost:4848 but it is not working for me. Here is what I have tried:

 Configurations\default-config\Logger Settings and I set the checkbox for Rotation on Date Change

and also

 Configurations\server-config\Logger Settings and I set the checkbox for Rotation on Date Change

Any help would be much appreciated. Thanks.

CodeHelp
  • 1,328
  • 5
  • 21
  • 37
  • After modifying these settings, did you restart the domain? – Ian Evans Sep 01 '13 at 23:10
  • What do you mean by restart the domain? I stop and restart the glassfish server using Netbeans. – CodeHelp Sep 02 '13 at 11:46
  • When you restart GlassFish, is the Rotation on Date Change check box checked under server-config -> Logger Settings? – Ian Evans Sep 05 '13 at 16:14
  • Also, you can check `/glassfish/domains/domain1/config/logging.properties` and make sure this property is set correctly: `com.sun.enterprise.server.logging.GFFileHandler.rotationOnDateChange=true` – Ian Evans Sep 05 '13 at 16:38
  • @IanEvans The Rotation on Date Change check box is checked under server-config->Logger Settings when I restart Glassfish. I also look into the logging.properties file and the property rotationOnDateChange=true is set. Any other suggestions? – CodeHelp Sep 06 '13 at 11:32
  • The only other thing I can think of is that the setting of Rotation on Date Change is overridden by the File Rotation Limit setting. You might try setting the latter to 0 and then seeing if server.log gets rotated at midnight. – Ian Evans Sep 09 '13 at 22:34
  • @IanEvans I cannot set the File Rotation Limit to 0. It gives me an error. – CodeHelp Sep 10 '13 at 12:14

2 Answers2

0

you can use asadmin from command line:

./asadmin --host localhost --port 4848 --user admin set-com.sun.enterprise.server.logging.GFFileHandler.rotationOnDateChange=true
user2438390
  • 3
  • 1
  • 6
0

If you want, you can to configure the retention log, using

asadmin> set-log-attributes com.sun.enterprise.server.logging.GFFileHandler.maxHistoryFiles=10

Source