Re: Stack valued MDC

2022-08-22 Thread Ralph Goers
I don’t see that as a problem at all. Log4jLogEvent’s constructor accepts a List of properties. We use this to inject properties configured on Loggers into the Context Map of the LogEvent. I see no reason why these key/value pairs shouldn’t be treated the same way. Ralph > On Aug 22, 2022, at

Re: Stack valued MDC

2022-08-22 Thread Piotr P. Karwasz
Hi everybody, Besides the enhanced NDC, there is another SLF4J 2.0 feature I don't really know how to deal with: https://www.slf4j.org/api/org/slf4j/spi/LoggingEventBuilder.html#addKeyValue-java.lang.String-java.lang.Object- These key/value pairs in the `LoggingEventBuilder` seem to be separate

Re: Stack valued MDC

2022-08-22 Thread Remko Popma
I don’t think that’s the only sane option. Another sane option is to ignore it. There’s nothing that says Log4j has to implement any enhanced SLF4J APIs. He wants to be the lowest common denominator in logging APIs, then he can’t add APIs that aren’t supported in the major implementations.

Re: Running under a SecurityManager

2022-08-22 Thread Piotr P. Karwasz
Hi Ralph, On Mon, 22 Aug 2022 at 09:50, Ralph Goers wrote: > It looks to me that the issue in 2.18.0 is that ServiceLoaderUtil is > accessing ServiceLoader via a MethodHandle and that must be requiring the > SecurityManager. We are using MethodHandlers so that it will work properly in > a JPMS

Re: Stack valued MDC

2022-08-22 Thread Ralph Goers
It would be weird IMO to provide a PatternConverter for an NDC stack that is supported by SLF4J but not Log4j. Unfortunately, I think the only sane thing to do is option 1. Ralph > On Aug 22, 2022, at 8:45 AM, Piotr P. Karwasz wrote: > > Hi all, > > On Sat, 16 Apr 2022 at 00:17, Carter Kozak

Re: Stack valued MDC

2022-08-22 Thread Piotr P. Karwasz
Hi all, On Sat, 16 Apr 2022 at 00:17, Carter Kozak wrote: > I can understand how the stack-based mdc might be convenient and useful, but > I don't think it fits my use-cases. That said, I wonder if the API could be > improved in such a way that it could leverage the application stack instead >

JDK 19 first Release Candidates!

2022-08-22 Thread David Delabassee
Greetings! I hope you had a chance to take some time off. On our side, and despite the summer vacation, everything is on track for the Java 19 GA release on September 20th with JDK 19 now in the Release Candidate Phase [1]. If you haven't done so yet, it is time to start testing your project(s

Re: Running under a SecurityManager

2022-08-22 Thread Ralph Goers
I we don’t have permission to use ServiceLoader Log4j will simply fail to initialize with anything other than SimpleLoggerContextFactory (i.e. - nothing in log4j-core will work). It looks to me that the issue in 2.18.0 is that ServiceLoaderUtil is accessing ServiceLoader via a MethodHandle and