Re: Multiple applications using GetLogger with same name

2023-08-01 Thread Ralph Goers
I answered this same question on the dev list a week ago since you apparently cross posted to both. Here it is again. Your issue is related to you starting and stopping the LoggerContext while your application is in an unknown state. I can think of a few ways to deal with this. 1. Never

Re: Multiple applications using GetLogger with same name

2023-08-01 Thread Piotr P. Karwasz
Hi Danish, On Tue, 1 Aug 2023 at 20:10, Danish Arif wrote: > My use case is that my application uses the above mentioned method to get > logger and log. Appender and Logger have been set in log4j2.xml file. We > stop the Logger by getting all core appenders , removing them , then > stopping them

Multiple applications using GetLogger with same name

2023-08-01 Thread Danish Arif
Hi Log4j2 Team, My query is related to log4j2 working and uses of LogManager.getLogger(String name); method. My use case is that my application uses the above mentioned method to get logger and log. Appender and Logger have been set in log4j2.xml file. We stop the Logger by getting all core

Re: Multiple applications using GetLogger with same name

2023-08-01 Thread Eric Schwarzenbach
On 8/1/23 14:09, Danish Arif wrote: The second question to this issue Is there any solution if multiple instances of the same application which are agnostic to each other's existence, use GetLogger("SameName"); and log into files with names in incremental id appended dynamically. For Example App

Re: Multiple applications using GetLogger with same name

2023-08-01 Thread Piotr P. Karwasz
Hi Ralph, On Tue, 1 Aug 2023 at 20:58, Ralph Goers wrote: > 2. Partition your application so that the main application and each batch job > use their own ClassLoader. The ClassLoaderContextSelector (the default) will > then create a LoggerContext for each ClassLoader and each can have its own