If you’re making loggers per user, for example, that might make more sense as thread context data.
On Sat, Jun 29, 2019 at 06:11, Dominik Psenner <[email protected]> wrote: > Creating this many appenders is troublesome also for any operating system > because the number of open (file) handles is limited. A little bit old anf > thus possibly outdated but still provides insights into windows specific > details and highlights some corner stones for orientation: > > > https://blogs.technet.microsoft.com/markrussinovich/2009/09/29/pushing-the-limits-of-windows-handles/ > -- > Dominik Psenner > > On Sat, Jun 29, 2019, 12:00 Jochen Wiedmann <[email protected]> > wrote: > > > You are creating millions of loggers? Meaning either of > > > > - I have a million different logger Id's, and create a logger for > > every single one, or > > - I have a limited number of different logger Id's, but invoke > > LoggerContext.getLogger(String), or > > LogManager.getLogger(String), or something similar, with the same > > id's, over and over again? > > > > Whatever, but whyever do you need millions of Appenders? > > > > Jochen > > > > On Thu, Jun 27, 2019 at 8:38 PM Gaurav <[email protected]> wrote: > > > > > > I am creating millions of loggers. As, the logger is requested at > > runtime, I cannot store the configuration in the static log4j2.xml. So, I > > create a rolling file appender and attach it to a logger. > > > > > > On 2019/06/27 13:14:28, Ralph Goers <[email protected]> > wrote: > > > > You are creating millions of Loggers or millions of LoggerConfigs? > > What you are doing is incomplete. But why would you be dynamically > creating > > millions of Loggers and Appenders? Whatever you are doing I am sure there > > is a better way to do it. Can you please describe your use case and why > you > > think what you are doing solves it? > > > > > > > > Ralph > > > > > > > > > On Jun 27, 2019, at 5:28 AM, Gaurav <[email protected]> wrote: > > > > > > > > > > Hi all, > > > > > > > > > > My application creates millions of loggers and appenders. > > > > > > > > > > I'm worried about the memory usage. > > > > > > > > > > For that, I am doing following things. > > > > > 1.Remove appender from LoggerConfig. > > > > > 2.Stop the LoggerConfig. > > > > > 3. Remove logger from Configuration. > > > > > > > > > > But when I do the performance test, it prints the errors on console > > that "Attempted to append to non-started appender". > > > > > > > > > > Do I need to clear them like this? Is there any better way to do it > > in a performance intensive application? > > > > > > > > > > Please assist. > > > > > > > > > > > > > > > > > > > > -- Matt Sicker <[email protected]>
