Lucee is sometimes logging to the wrong site

I appreciate the link to LDEV-4263 … will re-check as time allows.

We’re sitting at ~400 instances / 100 files that need updating in our code to get rid of this misbehaving file attribute including 3rd party paid CFML.

the fix defaults back to named logs. if you can confirm it, we can backport to 5.3.9 i reckon

I cannot reproduce this (logging to wrong site) issue in
5.3.10.79-RC or 5.3.10.89-snapshot (so have not tried the 5.3.10.90-snapshot).

  • I do not see the logging issue in this .90-snapshot version.

@Zackster - I’ve reviewed the change / tried in our code and do want to point out the following observations:

  1. My new understanding is: passing log="application" is preferred over file="application" (but 5.3.10.90 handles file if you used it).
    Tracking the thread/history - this is because there’s caching/performance for log files specifically defined IN THE ADMIN.
  2. Code that uses a custom log file - MUST use the “file” attribute.
    I think this change should be reversed: https://lucee.daemonite.io/t/lucee-is-sometimes-logging-to-the-wrong-site/11364/18?u=phillyun

edit: and perhaps another example given for using log="application"

Example: file="site1" (will create a site1.log).
An attempt to pass log="site1" throws an error. Therefore the file attribute is (apparently) not deprecated (or maybe should not be deprecated? It would also introduce an ACF incompatibility if fully deprecated).

Lucee 5.3.10.90-SNAPSHOT Error (application)
Message The attribute log [site1log] does not exist, only the following log names are available: [application, datasource, deploy, exception, gateway, mail, mapping, memory, orm, remoteclient, requesttimeout, rest, scheduler, scope, search, thread, trace].
Stacktrace The Error Occurred in
/writeLog.cfm: line 17
called from C:\tmp\site1\Application.cfc: line 7
Java Stacktrace lucee.runtime.exp.ApplicationException: The attribute log [site1log] does not exist, only the following log names are available: [application, datasource, deploy, exception, gateway, mail, mapping, memory, orm, remoteclient, requesttimeout, rest, scheduler, scope, search, thread, trace].
at lucee.runtime.tag.Log.doStartTag(Log.java:231)
at writelog_cfm$cf.udfCall(/writeLog.cfm:17)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213)
at lucee.runtime.functions.system.CFFunction.call(CFFunction.java:109)
at application_cfc$cf$4.udfCall(/Application.cfc:7)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:696)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:584)
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1931)
at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:444)
at lucee.runtime.listener.ModernAppListener.onError(ModernAppListener.java:432)
at lucee.runtime.listener.MixedAppListener.onError(MixedAppListener.java:138)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2521)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2478)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2449)
at lucee.runtime.engine.Request.exe(Request.java:45)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1216)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1162)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:750)

that’s just a typo

we have backported the fix to 5.3.9.170

1 Like

Will give the latest 5.3.9.170 a go. Thank you for the quick backport work.

Re - typo

@Zackster It was a typo in my message, not the functionality. A custom log that isn’t defined in the admin cannot use the log attribute. The main point of my message still applies (log="customlog" will throw an error).