This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Open Source Projects and the fly likes Method getLogger of log4j Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Method getLogger of log4j" Watch "Method getLogger of log4j" New topic
Author

Method getLogger of log4j

Swerrgy Smith
Ranch Hand

Joined: Mar 26, 2010
Posts: 91
Hi all,

Can you tell me why we always need to use a class (or a name of a class) in the getLogger method?


Why don't we simply use a same name (for example "ABCDEFGH") for every .java file ?


Thank you very much.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3456
    
  12
Swerrgy Smith wrote:Why don't we simply use a same name (for example "ABCDEFGH") for every .java file ?

You could, but when you are reading a log file, which do you think would be more useful to see as part of the messages - the name of the class that generated the log message or a string that has no relation to the java class ?


Joanne
 
 
subject: Method getLogger of log4j