logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: writing log4j for my application
Date Sun, 21 Oct 2007 18:39:30 GMT

Logger logger = Logger.getLogger(this.getClass().getName());
Logger audit_create = Logger.getLogger("AUDIT.create");
Logger audit_manage = Logger.getLogger("AUDIT.manage");


logger.debug("some basic dumb debugging");

if (accountCreated) {
     audit_create.info("Created account: " + accountNum);
} else if (accountModified) {
     audit_manage.info("Modified account: " + accountNum);
}

Jake

At 10:50 AM 10/21/2007, you wrote:
 >
 >HI JAKE,
 >
 >   CAN YOU SEND ME A SAMPLE CODE OF THIS. OR ATLEAST SEND ME THE LINK WHICH
 >EXPLAINS ABOUT THIS.
 >
 >
 >
 >Jacob Kjome wrote:
 >>
 >>
 >> Loggers don't need to be named after classes.  For instance, you
 >> could have "AUDIT.create" and "AUDIT.manage" loggers which you use to
 >> log applicable activities.  You can use these audit loggers anywhere
 >> you need them, regardless of class or package.  You can also have
 >> loggers named after your classes for general debugging.
 >>
 >> Jake
 >>
 >> At 03:50 AM 10/20/2007, you wrote:
 >>  >
 >>  >Hi everybody,
 >>  >
 >>  >I had written a web application for some banking project in Struts. The
 >>  >problem is i have categorized the ActionForm classes into one package,
 >>  >Action classes in one package and so on. Now i have to log the logging
 >>  >information in to two different log files that contains, like in one log
 >>  >file all the creation of accounts information must be logged and in
 >> other
 >>  >log file Viewing of balance info, transfer and so on log information and
 >> may
 >>  >be all the error information in to one more log file. I want to write
 >> the
 >>  >configuration file in an xml file. can any one tell me how this can be
 >>  >possible. ie how we are going to categorize logging information into
 >>  >different log files base on the fucntionality of our application. I feel
 >>  >happy if any one can come with code.
 >>  >
 >>  >I am using Struts and Log4JLogger.
 >>  >
 >>  >Thanks in advance.
 >>  >--
 >>  >View this message in context:
 >>
 >>
 >>http://www.nabble.com/writing-log4j-for-my-application-tf4657281.html
 >#a13307974
 >>  >Sent from the Log4j - Dev mailing list archive at Nabble.com.
 >>  >
 >>  >
 >>  >---------------------------------------------------------------------
 >>  >To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
 >>  >For additional commands, e-mail: log4j-dev-help@logging.apache.org
 >>
 >>
 >> ---------------------------------------------------------------------
 >> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
 >> For additional commands, e-mail: log4j-dev-help@logging.apache.org
 >>
 >>
 >>
 >
 >--
 >View this message in context:
 >http://www.nabble.com/writing-log4j-for-my-application-tf4657281.html#a13330337
 >Sent from the Log4j - Dev mailing list archive at Nabble.com.
 >
 >
 >---------------------------------------------------------------------
 >To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
 >For additional commands, e-mail: log4j-dev-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message