[ https://issues.apache.org/jira/browse/KNOX-1462?focusedWorklogId=647949&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-647949 ]
ASF GitHub Bot logged work on KNOX-1462: ---------------------------------------- Author: ASF GitHub Bot Created on: 08/Sep/21 13:15 Start Date: 08/Sep/21 13:15 Worklog Time Spent: 10m Work Description: zeroflag commented on a change in pull request #488: URL: https://github.com/apache/knox/pull/488#discussion_r704406704 ########## File path: gateway-i18n-logging-log4j/src/main/java/org/apache/knox/gateway/i18n/messages/loggers/log4j/Log4jMessageLogger.java ########## @@ -37,42 +31,15 @@ @Override public final boolean isLoggable( final MessageLevel level ) { - return logger.isEnabledFor( toLevel( level ) ); + return logger.isEnabled( toLevel( level ) ); } @Override public final void log( final StackTraceElement caller, final MessageLevel messageLevel, final String messageId, final String messageText, final Throwable thrown ) { - LoggingEvent event = new LoggingEvent( - /* String fqnOfCategoryClass */ CLASS_NAME, - /* Category logger */ logger, - /* long timeStamp */ System.currentTimeMillis(), - /* Level level */ toLevel( messageLevel ), - /* Object message */ messageText, - /* String threadName */ Thread.currentThread().getName(), - /* ThrowableInformation throwable */ toThrownInformation( thrown ), - /* String ndc */ null, - /* LocationInfo info */ toLocationInfo( caller ), - /* java.util.Map properties */ null ); - logger.callAppenders( event ); - } - - private static ThrowableInformation toThrownInformation( final Throwable thrown ) { - ThrowableInformation info = null; - if( thrown != null ) { - info = new ThrowableInformation( thrown ); - } - return info; - } - - private static LocationInfo toLocationInfo( final StackTraceElement caller ) { - LocationInfo info = null; - if( caller != null ) { - info = new LocationInfo( caller.getFileName(), caller.getClassName(), caller.getMethodName(), Integer.toString(caller.getLineNumber()) ); - } - return info; + logger.log(toLevel(messageLevel), messageText, thrown); Review comment: No, this doesn't fully work yet. There is no callAppenders in log4j2, I need to find an equivalent method. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@knox.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 647949) Time Spent: 1h 40m (was: 1.5h) > Migrate from Log4j 1.x to 2.x > ----------------------------- > > Key: KNOX-1462 > URL: https://issues.apache.org/jira/browse/KNOX-1462 > Project: Apache Knox > Issue Type: Improvement > Reporter: Kevin Risden > Assignee: Attila Magyar > Priority: Blocker > Fix For: 2.0.0 > > Time Spent: 1h 40m > Remaining Estimate: 0h > > Assigning to version 1.2.0 to have a discussion about it. > Log4j 1.x went EOL in August 2015. JDK 9+ support (KNOX-1458) will require > Log4j 2 since Knox uses MDC for all the audit logging. More details about the > issue and migration are found here: > * [https://blogs.apache.org/logging/entry/moving_on_to_log4j_2] > * [https://logging.apache.org/log4j/2.x/manual/migration.html] > Items of "concern" > * MDC migrate to ThreadContext > * log4j.properties need to migrate to log4j2.xml (or yaml or json) > Benefits > * Async logging > * Dynamic reloading of configuration changes -- This message was sent by Atlassian Jira (v8.3.4#803005)