Reputation: 937
Is it okay to have a org.apache.log4j.Logger field in a singleton class? Could be any concurrency issues because of sharing it among multiple threads?
Upvotes: 4
Views: 1558
Reputation: 24124
No, a Logger object can be used by multiple threads, did you face any issues?
Upvotes: 1
Reputation: 7214
Nope, there'll be no problems because it's thread-safe (i.e. it won't break if multiple threads are accessing it at the same time).
See http://logging.apache.org/log4j/1.2/faq.html#a1.7
Upvotes: 5