[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15838001#comment-15838001 ]
Matt Sicker commented on LOG4J2-1705: ------------------------------------- I think you need to be a committer in Logging Services to write to that repo. Go ahead and work in your fork for now and we'll help keep it merged for now. As for location-aware logging, I have a bit of experience in that area, so I can help you with that. The main thing to handle is keeping track of your Logger class name like seen in [log4j-slf4j-impl|https://github.com/apache/logging-log4j2/blob/master/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/Log4jLogger.java], [log4j-jcl|https://github.com/apache/logging-log4j2/blob/master/log4j-jcl/src/main/java/org/apache/logging/log4j/jcl/Log4jLog.java], and [log4j-jul|https://github.com/apache/logging-log4j2/blob/master/log4j-jul/src/main/java/org/apache/logging/log4j/jul/WrappedLogger.java] (although this one is more complicated as there are two implementations of logger wrappers, so there's some extra indirection going on here). If Kotlin supports macros like Scala, then you might be able to do [something like this|https://github.com/apache/logging-log4j-scala/blob/master/log4j-api-scala_2.12/src/main/scala/org/apache/logging/log4j/scala/Logger.scala] as location info should still work properly if your wrapper is unrolled at compile time. Overall, the main thing to keep in mind is that if you expand the call stack by wrapping method invocations, you need to specify which class name is the outermost logging class so that when the location information is obtained, the code can walk past the logger parts of the call stack to find the callee info. Internal JDK classes have a convenience annotation, {{@CallerSensitive}} that makes this much easier, but unfortunately that's an internal API we can't use. > Kotlin wrapper for Log4j 2 API > ------------------------------ > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API > Reporter: Raman Gupta > Fix For: 2.8.1 > > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org