RE: Pls help me in configuring common logger
Hi Van I am not using simple logger.I am using apache's commons logger.Pls le me know how to do it Thanks Sougata -Original Message- From: Van Riper, Mike [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 12:38 PM To: 'Struts Users Mailing List' Subject: RE: Pls help me in configuring common logger -Original Message- From: sougata [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 9:15 PM To: Struts Users Mailing List Subject: Pls help me in configuring common logger Hi Guys I am facing a problem in configuration apaches common logger using weblogic8.1.I want to send all my log message to a perticular file.I am using Common logger for my logging message.How to configure Pls let me know The simple logger that is included in the commons logging package doesn't support logging to a file, just to the console. You need to understand that it is primarily intended to provide the common logging API (the simple logger is included just to get you started) and then you configure it to use whatever logging facility under the covers that you want to. Most people use log4j, but, you could also use the native logging support in JDK 1.4 or greater. I recommend configuring to use log4j. I also recommend taking the time to read the short intro manual to log4j found here: http://tinyurl.com/3hlrq I recently posted the contents of a simple log4j configuration file that does have an example of the necessary configuration to write log messages both to the console and to file. Check the list archives for a recent post on logging by me. I use this setup with Tomcat and Weblogic. The one configuration difference I found is that Weblogic doesn't like relative file paths for location of log files and Tomcat handles that just fine. Good luck, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ P.S. You can either remove the commons logging properties file or explicitly configure it to use log4j. As long as you setup log4j properly in your runtime environment, the commons logging logic will use it by default unless you have a commons logging properties file that explicitly specifies a different logger implementation. Thanks Sougata - 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]
Re: Pls help me in configuring common logger
On 26 Mar 2004 13:59:25 -, struts-user-digest-help wrote Re: Pls help me in configuring common logger 109791 by: sougata sougata, if you're using Log4j you need to add a file called commons-logging.properties file under your WEB-INF/classes directory. In that file you need one line: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger Its been my experience that the commons logger does not actually default to Log4j if its available. Here is an example of a log4j.properties file: log4j.rootLogger=ERROR, A1, A2 log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender log4j.appender.A2.file=[file path] log4j.appender.A2.append=true log4j.appender.A2.layout=org.apache.log4j.PatternLayout log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n The first one is configured for standard out. The second one writes logs to a file [file path]. This file should also go under WEB-INF/classes Roy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pls help me in configuring common logger
Sougata, I can point you in the right direction, but, I don't have time to spell everything out for you. I think you need to do some work on your own reading the commons logging docs. You need to understand the commons logging package and how to configure it to use log4j or the native logging facilities in JDK 1.4. When I mentioned the simple logger, I was referring to this implementation of org.apache.commons.logging.Log: org.apache.commons.logging.impl.SimpleLog If you are using the commons logging package, it has a properties file you can use to specify which Log interface implementation to use. I could be wrong, but, when this file is not provided my experience has been that it will automatically detect the presence of a properly configured log4j and instantiate a org.apache.commons.logging.impl.Log4JLogger. If a properly configured log4j is not detected, it will default back to the SimpleLog implementation. Good Luck, Van -Original Message- From: sougata [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 4:12 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Pls help me in configuring common logger Hi Van I am not using simple logger.I am using apache's commons logger.Pls le me know how to do it Thanks Sougata -Original Message- From: Van Riper, Mike [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 12:38 PM To: 'Struts Users Mailing List' Subject: RE: Pls help me in configuring common logger -Original Message- From: sougata [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 9:15 PM To: Struts Users Mailing List Subject: Pls help me in configuring common logger Hi Guys I am facing a problem in configuration apaches common logger using weblogic8.1.I want to send all my log message to a perticular file.I am using Common logger for my logging message.How to configure Pls let me know The simple logger that is included in the commons logging package doesn't support logging to a file, just to the console. You need to understand that it is primarily intended to provide the common logging API (the simple logger is included just to get you started) and then you configure it to use whatever logging facility under the covers that you want to. Most people use log4j, but, you could also use the native logging support in JDK 1.4 or greater. I recommend configuring to use log4j. I also recommend taking the time to read the short intro manual to log4j found here: http://tinyurl.com/3hlrq I recently posted the contents of a simple log4j configuration file that does have an example of the necessary configuration to write log messages both to the console and to file. Check the list archives for a recent post on logging by me. I use this setup with Tomcat and Weblogic. The one configuration difference I found is that Weblogic doesn't like relative file paths for location of log files and Tomcat handles that just fine. Good luck, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ P.S. You can either remove the commons logging properties file or explicitly configure it to use log4j. As long as you setup log4j properly in your runtime environment, the commons logging logic will use it by default unless you have a commons logging properties file that explicitly specifies a different logger implementation. Thanks Sougata - 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]
RE: Pls help me in configuring common logger
-Original Message- From: sougata [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 9:15 PM To: Struts Users Mailing List Subject: Pls help me in configuring common logger Hi Guys I am facing a problem in configuration apaches common logger using weblogic8.1.I want to send all my log message to a perticular file.I am using Common logger for my logging message.How to configure Pls let me know The simple logger that is included in the commons logging package doesn't support logging to a file, just to the console. You need to understand that it is primarily intended to provide the common logging API (the simple logger is included just to get you started) and then you configure it to use whatever logging facility under the covers that you want to. Most people use log4j, but, you could also use the native logging support in JDK 1.4 or greater. I recommend configuring to use log4j. I also recommend taking the time to read the short intro manual to log4j found here: http://tinyurl.com/3hlrq I recently posted the contents of a simple log4j configuration file that does have an example of the necessary configuration to write log messages both to the console and to file. Check the list archives for a recent post on logging by me. I use this setup with Tomcat and Weblogic. The one configuration difference I found is that Weblogic doesn't like relative file paths for location of log files and Tomcat handles that just fine. Good luck, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ P.S. You can either remove the commons logging properties file or explicitly configure it to use log4j. As long as you setup log4j properly in your runtime environment, the commons logging logic will use it by default unless you have a commons logging properties file that explicitly specifies a different logger implementation. Thanks Sougata - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pls help me in configuring common logger
i shall my two cents to this, do read the article on onlamp.com and go though the source code as well. i just had to do the same this morning to refresh my log4j skills. - Original Message - From: Van Riper, Mike [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, March 26, 2004 12:37 PM Subject: RE: Pls help me in configuring common logger -Original Message- From: sougata [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 9:15 PM To: Struts Users Mailing List Subject: Pls help me in configuring common logger Hi Guys I am facing a problem in configuration apaches common logger using weblogic8.1.I want to send all my log message to a perticular file.I am using Common logger for my logging message.How to configure Pls let me know The simple logger that is included in the commons logging package doesn't support logging to a file, just to the console. You need to understand that it is primarily intended to provide the common logging API (the simple logger is included just to get you started) and then you configure it to use whatever logging facility under the covers that you want to. Most people use log4j, but, you could also use the native logging support in JDK 1.4 or greater. I recommend configuring to use log4j. I also recommend taking the time to read the short intro manual to log4j found here: http://tinyurl.com/3hlrq I recently posted the contents of a simple log4j configuration file that does have an example of the necessary configuration to write log messages both to the console and to file. Check the list archives for a recent post on logging by me. I use this setup with Tomcat and Weblogic. The one configuration difference I found is that Weblogic doesn't like relative file paths for location of log files and Tomcat handles that just fine. Good luck, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ P.S. You can either remove the commons logging properties file or explicitly configure it to use log4j. As long as you setup log4j properly in your runtime environment, the commons logging logic will use it by default unless you have a commons logging properties file that explicitly specifies a different logger implementation. Thanks Sougata - 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]