Posted: 8 Feb 2016 13:02 EST Last activity: 28 Jul 2016 6:29 EDT
Log Rotation with DailySizeRollingFileAppenderPega
I am working on rotating my log files from within Pega based on Time and Size with the DailySizeRollingFileAppender in Pega 7.1.9. The application is running on JBoss EAP 6.4.4 on RHEL 6.
The time based portion of the appender seems to be working fine, but I am trying to also rotate based on the 'MaxFileSize' parameter. I lowered the value to 250KB for testing, but the log file is still being written to after the log size is met. Am I misinterpreting how the appender should work? or is something wrong with the syntax below? the $pega.log.location is a variable that I am passing via JAVA_OPTIONS
first check if without substitution, does the appender work (use hard-coded path)? I don't believe you can simply pass in an jvm argument for that. I see the default (web.tmpdir) substitution had to be set in the java code.
The initial log file is created, and is rotated at noon and midnight, but is not also being rotated if the MaxFileSize is reached prior to the time rotation. I have updated the appender to what is listed below, and the file still grows past the 250KB test size I have it configured to right now.
ls -lah test_file-2016-02-08*
-rw-r--r--. 1 jboss-as jboss 3.1M Feb 8 12:20 test_file-2016-02-08-AM.log
-rw-r--r--. 1 jboss-as jboss 1.4M Feb 8 16:07 test_file-2016-02-08-PM.log
-rw-r--r--. 1 jboss-as jboss 1.1M Feb 9 11:55 test_file-2016-02-09-AM.log
Is this a bug with the appender? Do you have any suggestions? The rotation is more time sensitive. I would rather use 'yyyy-MM-dd-a' with the DailyRollingFileAppenderPega appender (and no MaxFileSize) than use MaxFileSize and the DailySizeRollingFileAppenderPega.
Posted: 5 years ago
Posted: 9 Feb 2016 13:29 EST
Kevin Zheng (KevinZheng_GCS)
Director, Software Solutions Engineering
Thanks for sharing the findings. From the code, it does seem that only 'yyyy-MM-dd' is supported. But I am not 100% sure if this is a bug or enhancement request. ChaithanyaKumar Cholleti, can you provide your insights when you get a chance?