logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Wiedmann <jochen.wiedm...@gmail.com>
Subject Dynamically creating loggers
Date Fri, 15 Apr 2016 09:02:21 GMT
Hi,

I've got an application, where I would like to obtain loggers on the
fly, because the logger name isn't known in advance. (Think of it as a
logging server, which will be used by remote clients.)

Now, creating a Logger might be an expensive operation. Thus, my question:

- Would you recommend to always invoke LogManager.getLogger(String)
and use the result?
- Or would it be better to maintain a Map<String,Logger> with the
logger name as key?

Thanks,

Jochen

-- 
The next time you hear: "Don't reinvent the wheel!"

http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg

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


Mime
View raw message