Log4j Logger and concurrency

Is it possible to have an org.apache.log4j.Logger field in a singleton class? Are there any concurrency issues due to sharing it between multiple threads?

+4
source share
2 answers

No, there will be no problems, since it is thread safe (that is, it will not break if multiple threads access it at the same time).

See http://logging.apache.org/log4j/1.2/faq.html#a1.7

+5
source

No, the Logger object can be used by multiple threads, have you had any problems?

+1
source

All Articles