Re: Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-26 Thread Piotr P. Karwasz
Joan,

On Fri, 26 Jan 2024 at 13:33,  wrote:
> Issue fixed. The problem was in the disruptor library, which we also migrated 
> from 3.4.4 to 4.0.0. Downgrading again to 3.4.4. fixed the problem.

Thank you for sharing your solution with us. Since nobody was able to
diagnose this problem from your status logs, I opened issue #2250[1]
to add the correct log statements during the initialization of LMAX
Disruptor.

Note also, that the upcoming version 2.23.0 will support both LMAX
Disruptor 3.x and 4.x (cf. issue #1829[2]), so you'll be able to
upgrade to 4.x.

As far as version 3.x of Log4j is concerned, our upcoming 3.0.0-beta2
will feature a separate `log4j-async-logger` artifact with a
non-optional dependency on `com.lmax.disruptor:disruptor`[3]. We hope
to relieve users from the burden of upgrading the Disruptor library
themselves and rely on the transitive dependency in
`log4j-async-logger`.

Piotr

[1] https://github.com/apache/logging-log4j2/issues/2250
[2] https://github.com/apache/logging-log4j2/issues/1829
[3] https://github.com/apache/logging-log4j2/pull/2241

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



RE: Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-26 Thread joan.balaguero
Hi,

Issue fixed. The problem was in the disruptor library, which we also migrated 
from 3.4.4 to 4.0.0. Downgrading again to 3.4.4. fixed the problem.

Regards,

Joan.

-Original Message-
From: Piotr P. Karwasz  
Sent: Thursday, January 25, 2024 1:20 PM
To: Log4J Users List 
Subject: Re: Async logger not logging after upgrading tomcat, jdk and log4j

Hi Joan,

On Thu, 25 Jan 2024 at 12:06,  wrote:
> My application has been using async logging for years by setting this env 
> variable on tomcat 8.5.x running on java 11 with log4j-2.15/6/7/8/9:
> -DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncL
> oggerContextSelector
>
> Now we have migrated to Tomcat 10.1.18, java 17 and log4j-2.22.1. With the 
> above variable set, nothing is logged. If I remove it then it starts to log 
> again, but without async.
>
> Is there any change I'm missing regarding this async logging when moving to 
> these new versions of tomcat, java and log4j?

Can you test with
`-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector`
since `Log4jContextSelector` is deprecated since 2.10?

Although it should have no influence on the context selector, if you were using 
`log4j-web`, did you switch to `log4j-jakarta-web`?

Piotr

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org




-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



RE: Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-25 Thread joan.balaguero
gistering but no MBeans found matching 
'org.apache.logging.log4j2:type=55494dde,component=AsyncLoggerRingBuffer'
TRACE StatusLogger Unregistering but no MBeans found matching 
'org.apache.logging.log4j2:type=55494dde,component=Loggers,name=*,subtype=RingBuffer'
DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=55494dde
DEBUG StatusLogger Registering MBean 
org.apache.logging.log4j2:type=55494dde,component=StatusLogger
DEBUG StatusLogger Registering MBean 
org.apache.logging.log4j2:type=55494dde,component=ContextSelector
DEBUG StatusLogger Registering MBean 
org.apache.logging.log4j2:type=55494dde,component=Appenders,name=DefaultConsole-2

Joan.

-----Original Message-
From: joan.balagu...@ventusproxy.com  
Sent: Thursday, January 25, 2024 1:56 PM
To: 'Log4J Users List' 
Subject: RE: Async logger not logging after upgrading tomcat, jdk and log4j

Hello,

Here is the trace when starting tomcat with 
'-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector':
https://gist.github.com/joanbalaguero/1fa286417bfc9dbd3ce75e043bd26f3d

It seems the async contexts are started, but maybe someone can see something 
wrong that makes the log does not work.

Thanks,

Joan.



-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org




-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



RE: Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-25 Thread joan.balaguero
Hello,

Here is the trace when starting tomcat with 
'-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector':
https://gist.github.com/joanbalaguero/1fa286417bfc9dbd3ce75e043bd26f3d

It seems the async contexts are started, but maybe someone can see something 
wrong that makes the log does not work.

Thanks,

Joan.



-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



RE: Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-25 Thread joan.balaguero
Hi Ganesh,

I already have this 
2.22.1. The war file 
contains the right libraries, all in version 2.22.1.

Where can I see the supported tomcat/java versions depending on the log4j 
version?

Thanks,

Joan.


-Original Message-
From: Ganesh S  
Sent: Thursday, January 25, 2024 1:14 PM
To: Log4J Users List 
Subject: Re: Async logger not logging after upgrading tomcat, jdk and log4j

Hello,

Check the dependency hierarchy, which version of log4j is being used.

I had faced similar issue, even though if I specified some particular version 
of log4j, maven was not picking that particular version though there were no 
other dependencies which were using log4j at any nested level.

For that I had added the below in the pom.xml file


2.22.1

After this also if it doesn't work pick the appropriate version of log4j which 
supports your version of Java and tomcat.

On Thu, Jan 25, 2024, 4:35 PM  wrote:

> Hello,
>
> I would like to ask about this issue before starting to post debug logs.
>
> My application has been using async logging for years by setting this 
> env variable on tomcat 8.5.x running on java 11 with log4j-2.15/6/7/8/9:
>
> -DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncL
> oggerContextSelector
>
> Now we have migrated to Tomcat 10.1.18, java 17 and log4j-2.22.1. With 
> the above variable set, nothing is logged. If I remove it then it 
> starts to log again, but without async.
>
> Is there any change I'm missing regarding this async logging when 
> moving to these new versions of tomcat, java and log4j?
>
> Thanks,
>
> Joan.
>
>
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>
>


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



RE: Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-25 Thread joan.balaguero
Hi Piotr,

I already did it ... no success.

Thanks,

Joan.

-Original Message-
From: Piotr P. Karwasz  
Sent: Thursday, January 25, 2024 1:20 PM
To: Log4J Users List 
Subject: Re: Async logger not logging after upgrading tomcat, jdk and log4j

Hi Joan,

On Thu, 25 Jan 2024 at 12:06,  wrote:
> My application has been using async logging for years by setting this env 
> variable on tomcat 8.5.x running on java 11 with log4j-2.15/6/7/8/9:
> -DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncL
> oggerContextSelector
>
> Now we have migrated to Tomcat 10.1.18, java 17 and log4j-2.22.1. With the 
> above variable set, nothing is logged. If I remove it then it starts to log 
> again, but without async.
>
> Is there any change I'm missing regarding this async logging when moving to 
> these new versions of tomcat, java and log4j?

Can you test with
`-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector`
since `Log4jContextSelector` is deprecated since 2.10?

Although it should have no influence on the context selector, if you were using 
`log4j-web`, did you switch to `log4j-jakarta-web`?

Piotr

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org




-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-25 Thread Piotr P. Karwasz
Hi Joan,

On Thu, 25 Jan 2024 at 12:06,  wrote:
> My application has been using async logging for years by setting this env 
> variable on tomcat 8.5.x running on java 11 with log4j-2.15/6/7/8/9:
> -DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector
>
> Now we have migrated to Tomcat 10.1.18, java 17 and log4j-2.22.1. With the 
> above variable set, nothing is logged. If I remove it then it starts to log 
> again, but without async.
>
> Is there any change I'm missing regarding this async logging when moving to 
> these new versions of tomcat, java and log4j?

Can you test with
`-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector`
since `Log4jContextSelector` is deprecated since 2.10?

Although it should have no influence on the context selector, if you
were using `log4j-web`, did you switch to `log4j-jakarta-web`?

Piotr

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-25 Thread Ganesh S
Hello,

Check the dependency hierarchy, which version of log4j is being used.

I had faced similar issue, even though if I specified some particular
version of log4j, maven was not picking that particular version though
there were no other dependencies which were using log4j at any nested level.

For that I had added the below in the pom.xml file


2.22.1

After this also if it doesn't work pick the appropriate version of log4j
which supports your version of Java and tomcat.

On Thu, Jan 25, 2024, 4:35 PM  wrote:

> Hello,
>
> I would like to ask about this issue before starting to post debug logs.
>
> My application has been using async logging for years by setting this env
> variable on tomcat 8.5.x running on java 11 with log4j-2.15/6/7/8/9:
>
> -DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector
>
> Now we have migrated to Tomcat 10.1.18, java 17 and log4j-2.22.1. With the
> above variable set, nothing is logged. If I remove it then it starts to log
> again, but without async.
>
> Is there any change I'm missing regarding this async logging when moving
> to these new versions of tomcat, java and log4j?
>
> Thanks,
>
> Joan.
>
>
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>
>


Async logger not logging after upgrading tomcat, jdk and log4j

2024-01-25 Thread joan.balaguero
Hello,

I would like to ask about this issue before starting to post debug logs.

My application has been using async logging for years by setting this env 
variable on tomcat 8.5.x running on java 11 with log4j-2.15/6/7/8/9:
-DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector

Now we have migrated to Tomcat 10.1.18, java 17 and log4j-2.22.1. With the 
above variable set, nothing is logged. If I remove it then it starts to log 
again, but without async.

Is there any change I'm missing regarding this async logging when moving to 
these new versions of tomcat, java and log4j?

Thanks,

Joan.


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org