I would suggest read http://logging.apache.org/log4j/docs/manual.html
On 1/27/07, Padmanaban Varatharajan <[EMAIL PROTECTED]> wrote:
Hi I'm not clear. Do you mean to say, I'm overriding the previous properties? In case, if I use Logger.getRootLogger(), what will be the scenario? Will it be printing the log details in both the files? And how about for the consoleAppender? I have 2 console appenders, one with "INFO" and another with "Error" (New). The previous two appenders are part of the rootCategory. Can I add these two (new) in the same? Or a new category? log4j.category.CategoryName=INFO, NEWFILE, NEWCONSOLE If a new category, how to access the same in code? Is that like I mentioned earlier Category.getInstance("CategoryName")? As I said already, I'm new to this. Please I need little more explanation/code sample. Hope, I'm not hurting you. We can even talk... [EMAIL PROTECTED] as I need this badly and quickly... Thanks again padmanaban -----Original Message----- From: James Stauffer [mailto:[EMAIL PROTECTED] Sent: Saturday, January 27, 2007 10:17 PM To: Padmanaban Varatharajan Subject: Re: Using Log4J You don't have to do anything special. Your current Logger statement should work fine because you are attaching the new appenders to the same logger. On 1/27/07, Padmanaban Varatharajan <[EMAIL PROTECTED]> wrote: > > > > > Hi James > > > > First of all, thanks for your response. I'm almost certain with the > properties file. But I guess that, I'm missing something in my java code. As > I'm new to this I need a little more info on this. > > > > Do I need to use something like this? > > > > Category.getInstance("NEWFILE") and Category.getInstance("NEWCONSOLE") > > > > Or Logger.getLogger("NEWFILE") and Logger.getLogger("NEWCONSOLE") > > > > Please help me out with sample java code to access the new categories I > define in log4j.properties. > > > > Thanks Again. > > > > Thanks & Regards > > Padmanaban > > > > > -----Original Message----- > From: James Stauffer [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 25, 2007 8:51 PM > To: Log4J Users List > Subject: Re: Using Log4J > > > > There should be no problems doing that. You will just want to set the > > Threshold to ERROR on NEWCONSOLE. > > > > On 1/25/07, Padmanaban Varatharajan > <[EMAIL PROTECTED]> wrote: > > > > > > Hi All, > > > > > > > > > > > > In Log4J, I have to use the same properties file (log4j.properties) in > > > which I have certain configuration details already defined with the > > > following: > > > > > > > > > > > > Existing: log4j.rootcategory=INFO, CONSOLE, LOGFILE > > > > > > > > > > > > * Default logging level is INFO and two appenders. > > > > > > * One is ConsoleAppender and the other is FileAppender. > > > > > > * And the threshold level is INFO for both the appenders > > > > > > > > > > > > And my Requirement is > > > > > > * I need to use another appender, which will be > > > RollingFileAppender > > > > > > * The threshold level is INFO > > > > > > * Need to write the logging details in a different file. > > > > > > > > > > > > Also > > > > > > * I would like to use another consoleAppender with the logging > > > level as ERROR. As the existing one is having INFO level. > > > > > > > > > > > > Say: log4j.rootcategory=INFO, CONSOLE, LOGFILE, NEWFILE, NEWCONSOLE > > > > > > > > > > > > Can anyone help me to achieve this? Also, tell me how to use the same in > > > the java code? Sample code will do better and appreciable. > > > > > > > > > > > > Please respond me ASAP. > > > > > > > > > > > > Thanks > > > > > > Padmanaban > > > > > > > > > > > > This message and the information contained herein is proprietary and > confidential and subject to the Amdocs policy statement, > > > you may review at > http://www.amdocs.com/email_disclaimer.asp > > > > > > > > > -- > > James Stauffer > http://www.geocities.com/stauffer_james/ > > Are you good? Take the test at > http://www.livingwaters.com/good/ > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > -- James Stauffer http://www.geocities.com/stauffer_james/ Are you good? Take the test at http://www.livingwaters.com/good/ This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at http://www.amdocs.com/email_disclaimer.asp
-- James Stauffer http://www.geocities.com/stauffer_james/ Are you good? Take the test at http://www.livingwaters.com/good/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]