The string passed to getLogger is arbitrary, but is generally the fully-qualified class name.
Here's a bit more concrete example that should make it clearer: class A { private static final Logger SQL_LOG = Logger.getLogger("sql"); private static final Logger LOG = Logger.getLogger("mypackage.A"); public void m1() { LOG.info("About to talk to the database"); SQL_LOG.info("selet sysdate from dual"); // execute the sql } } class B { private static final Logger SQL_LOG = Logger.getLogger("sql"); private static final Logger LOG = Logger.getLogger("mypackage.B"); public void m1() { LOG.info("About to talk to the database"); SQL_LOG.info("selet sysdate from dual"); // execute the sql } } A.SQL_LOG and B.SQL_LOG both point to the same Logger, so messages are sent to the same place. A.LOG and B.LOG point to different Loggers, but they are in the same namespace. So you can configure them seperately by referring to their fully-qualified names ("mypackage.A" and "mypackage.B"), or configure them both by referring to their common namespace ("mypackage"). -Jim Moore -----Original Message----- From: Vikas Phonsa [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 8:19 PM To: '[EMAIL PROTECTED]' Subject: basic question from a newbie Hi guys, I started with log4j couple of hrs ago and I'm reading thru the documentation and its making sense. I have gone too far into it, but one basic thing is confusing me. What exactly is a logger. When u say Logger log1 = Logger.getLogger("com.foo.Bar"); What is com.foo.Bar, is that some object that is automatically generated or what ? The basic examples don't require the creation of any such class or object. Then what is it ? When I really start using log4j, then would I be required to create any such "logger" classes/objects. Can't figure out what's going on here. Thanks Vikas --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]