OS: Windows Server 2022 (10.0) 64bit
Java Version: 11.0.24 (Eclipse Adoptium) 64bit
Tomcat Version: Apache Tomcat/9.0.96
Lucee Version: 6.1.0.243
We are currently in the process of upgrading from Lucee 5.4.5.23 to Lucee 6 hoping that the issues we were experiencing with logging would be resolved but it looks like it is still not working properly. For some reason, at some point the logs just stop writing to application.log and the only way to get logging to resume is to toggle the logging options in the administrator which seems to trigger logs being written to the file again.
I suspect the issue is occurring when the file gets close to the max file size that something is failing and the logs just stop, however I could not find anything in the error logs to prove it.
I looked at the code for the ResourceAppender but I am not sure how/when the appender is triggered within the application. (Lucee/core/src/main/java/lucee/commons/io/log/log4j2/appender/ResourceAppender.java at 6.1.0.243 · lucee/Lucee · GitHub)
Logging Settings
Max File Size (in bytes) : 14485760
Screenshot AFTER logs were restarted by toggling logging options in the administrator
- Seemed to trigger log rotation and now there is a .bak file from when the logs stopped yesterday evening
1 Like
Hi,
I would be curious to know if your windows 2022 is patched to 21H2.
There was an issue with several other tomcat servcies breaking after the patch.
Adding adding this line to server.xml corrected the issue in simular cases.
Server port=“8008” shutdown=“SHUTDOWN”
Typically server port is 8005 by default
8005 is also used by SCCM
As for application log growing, you may want to implement a simple log rotate script, or configure log shipping or proper rotation.
something like this:
<cfset logDir = expandPath(“c:/lucee/tomcat/logs/”)>
<cfset currentLogFile = logDir & “application.log”>
<cfset dateFormatted = dateFormat(now(), “dd-MM-yyyy”)>
<cfset backupLogFile = logDir & dateFormatted & “-application.log”>
<!-- Create a new application.log -->
<cffile action="write" file="#currentLogFile#" output="">
<!-- Log a message indicating the log rotation -->
<cflog file="application" text="Log file rotated: #backupLogFile#">
<cfcatch>
<!-- OH crap ERROR -->
<cflog file="application" text="Error during log rotation: #cfcatch.message#">
</cfcatch>
We have configured log rotation through the Lucee server admin but the issue is that it does not seem to work properly. We are now using a Powershell job as a work around but would like to use the built in log rotation instead.
I was unable to post multiple screenshots when I initially reported the issue but it seems to just stop writing to the application.log file when it gets close to the max file size.
Current Settings
the service Lucee is running as needs to have read, write, list contents, execute, for the files and folder the log goes into.
I checked the permissions for Lucee Service and it has full control.
Oddly enough I trigger the logs to rotate by toggling the stream timeout in settings but since it never automatically rotated and went over the max file size it created 10 files all of which were the same size.
I would have expected it to create a new file application.log.1.bak (or maybe 2 files since the file was already over 14MB) and delete everything from application.log so that it would then be 0KB. At that point logging should resume until it gets to the max file size.
Screenshot AFTER logs rotation was manually triggered by toggling options in the administrator