Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

August 26, 2010

Important points : java.util.Logger

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:

Scott Vachalek said...

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.

Anonymous said...

Find and pick some good things from you and it helps me to solve a problem, thanks.

- Henry