-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBORM errors on newer Lucee versions because log4j appenders have moved #56
Comments
What's funny is that this shows in the test suite https://github.com/coldbox-modules/cborm/runs/7094574945?check_suite_focus=true#step:10:219 <td class="label">Java Stacktrace</td>
<td>lucee.runtime.exp.NativeException: cannot load class through its string name, because no definition for the class with the specified name [org.apache.log4j.Logger] could be found caused by (java.lang.ClassNotFoundException:org.apache.log4j.Logger not found by lucee.core [49];java.lang.ClassNotFoundException:org.apache.log4j.Logger;)<br><span style='margin-right: 1em;'> </span>
at lucee.commons.lang.ClassUtil.loadClass(ClassUtil.java:296)<br><span style='margin-right: 1em;'> </span>
at lucee.runtime.functions.other.JavaProxy.loadClassByPath(JavaProxy.java:130)<br><span style='margin-right: 1em;'> </span>
at lucee.runtime.functions.other.JavaProxy.loadClass(JavaProxy.java:65)<br><span style='margin-right: 1em;'> </span>
at lucee.runtime.functions.other.JavaProxy.call(JavaProxy.java:60)<br><span style='margin-right: 1em;'> </span>
at lucee.runtime.functions.other.CreateObject.doJava(CreateObject.java:140)<br><span style='margin-right: 1em;'> </span>
at lucee.runtime.functions.other.CreateObject.call(CreateObject.java:62)<br><span style='margin-right: 1em;'> </span>
at lucee.runtime.functions.other.CreateObject.call(CreateObject.java:49)<br><span style='margin-right: 1em;'> </span>
at models.util.ormutilsupport_cfc$cf.udfCall1(/cborm/models/util/ORMUtilSupport.cfc:24)<br><span style='margin-right: 1em;'> </span>
at models.util.ormutilsupport_cfc$cf.udfCall(/cborm/models/util/ORMUtilSupport.cfc) |
I've attempted to fix this via the following Help, anyone? try {
// older Log4j code here...
} catch( any e ){
// Log4j 2 implementation 😡
var log4jLevel = createObject( "java", "org.apache.logging.log4j.Level" );
var logManager = createObject( "java", "org.apache.logging.log4j.LogManager" );
var hibernateLog = logManager.getLogger( "org.hibernate" );
var logEngine = getPageContext().getConfig().getLogEngine();
var consoleAppender = logEngine.getAppender( getPageContext().getConfig(), logEngine.getClassicLayout(), "console", logEngine.appenderClassDefintion( "console" ), javaCast( "null", 0 ) );
hibernateLog.setLevel( log4jLevel[ arguments.level ] );
hibernateLog.addAppender( consoleAppender );
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CBORM causes an error on Lucee 5.3.9.141 because
lucee.commons.io.log.log4j.layout.ClassicLayout
no longer exists.See https://github.com/coldbox-modules/cborm/blob/development/models/util/ORMUtilSupport.cfc#L32-L39:
It appears this moved to
lucee.commons.io.log.log4j2.layout.ClassicLayout
.Ditto for
lucee.commons.io.log.log4j.appender.ConsoleAppender
, which moved tolucee.commons.io.log.log4j2.appender.ConsoleAppender
The text was updated successfully, but these errors were encountered: