Am removing this from the “Unsolicited log file rotation” thread as it’s not really on-topic there.
Back to this.
I had a look, but there’s no code that actually validates the passed-in struct and says “nah look you need these keys/values” as one might expect. Lucee just dives in and starts using it, and because I’m having to guess at what it wants (and get it wrong, obvs), all I’m getting is a NPE when I come to use writeLog next. NB: not from when Application.cfc processes, which is when I’d expect this stuff to be checked (and accordingly fail if it’s invalid), but when the code comes to use stuff that has previously been “configured”.
Am not sure this is a production-ready feature given these findings? At the very least, I cannot move forward with guessing how it works. Am out of guesses.
lucee.runtime.exp.NativeException: java.lang.NullPointerException
at lucee.commons.io.log.log4j2.Log4j2Engine.layoutClassDefintion(Log4j2Engine.java:142)
at lucee.runtime.listener.ApplicationContextSupport.initLog(ApplicationContextSupport.java:335)
at lucee.runtime.listener.ModernApplicationContext.initLog(ModernApplicationContext.java:1757)
at lucee.runtime.listener.ModernApplicationContext.getLog(ModernApplicationContext.java:1731)
at lucee.runtime.PageContextImpl.getLog(PageContextImpl.java:3754)
at lucee.runtime.tag.Log.doStartTag(Log.java:217)
at index_cfm$cf$c.call(/index.cfm:2)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1043)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:935)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:219)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2475)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2465)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2436)
at lucee.runtime.engine.Request.exe(Request.java:45)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1198)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1144)
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:590)
...
(trimmed as the rest is just servlet and undertow output)
I also checked CFConfig style settings (I mean, why not?)
lucee.runtime.exp.NativeException: java.lang.NullPointerException
at lucee.commons.io.log.log4j2.Log4j2Engine.layoutClassDefintion(Log4j2Engine.java:142)
at lucee.runtime.listener.ApplicationContextSupport.initLog(ApplicationContextSupport.java:335)
at lucee.runtime.listener.ModernApplicationContext.initLog(ModernApplicationContext.java:1757)
at lucee.runtime.listener.ModernApplicationContext.getLog(ModernApplicationContext.java:1731)
at lucee.runtime.PageContextImpl.getLog(PageContextImpl.java:3754)
at lucee.runtime.tag.Log.doStartTag(Log.java:217)
at index_cfm$cf$c.call(/index.cfm:2)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1043)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:935)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:219)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2475)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2465)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2436)
at lucee.runtime.engine.Request.exe(Request.java:45)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1198)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1144)
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:590)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:47)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
(again, trimmed as you dont need undertow and fusion reactor stack trace, but I can provide)
I can see the sourecode defines the logs as:
And a log being defined as import lucee.commons.io.log.Log;