The Logger class implements Factory patter to return logger instance.
The getLogger() method will either create a new logger instance or return a suitable(having same name as specified) existing instance. Each logger has a level associated with it, which specifies the minimum level the logger takes care of. If a logger level is null, then its level is inherited from its parent.So, if the log level is changed for a class, the change would effect its child loggers which have the log level set as null.
Also, all methods in a logger are thread-safe.
2 comments:
Note that if you change the level on the parent, you need to keep a reference to it somewhere. Otherwise it may be garbage collected, and then the children won't inherit it.
Find and pick some good things from you and it helps me to solve a problem, thanks.
- Henry
Post a Comment