Could not find root logger information Is this OK?
Hello, I have configured log4j in my application server. I have defined the following log4j.properties log4j.debug=true log4j.threshold=ALL log4j.rootLogger=DEBUG,fileAppend log4j.rootCategory=DEBUG,fileAppend log4j.logger.com.businessobjects.security.jaas=DEBUG log4j.logger.org.apache=ERROR log4j.appender.conAppend=org.apache.log4j.ConsoleAppender #log4j.appender.conAppend.Threshold=INFO log4j.appender.conAppend.layout=org.apache.log4j.PatternLayout log4j.appender.conAppend.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n log4j.appender.fileAppend=org.apache.log4j.RollingFileAppender log4j.appender.fileAppend.Threshold=DEBUG log4j.appender.fileAppend.File=jsr168app.log log4j.appender.fileAppend.MaxFileSize=5MB log4j.appender.fileAppend.MaxBackupIndex=100 log4j.appender.fileAppend.Append=true log4j.appender.fileAppend.layout=org.apache.log4j.PatternLayout log4j.appender.fileAppend.layout.ConversionPattern=%d %-5p [%t] %-17c{2} - %m\r\n When I start my application server, I am seeing the following messages ... 08/03/19 04:33:55 log4j: Finished configuring. 08/03/19 04:33:55 log4j: Reading configuration from URL classloader:/META-INF/CrystalEnterprise.Trace/basic.properties 08/03/19 04:33:55 log4j: Could not find root logger information. Is this OK? 08/03/19 04:33:55 log4j: Parsing for [com.businessobjects.sdk] with value=[ERROR, CE1]. 08/03/19 04:33:55 log4j: Level token is [ERROR]. 08/03/19 04:33:55 log4j: Category com.businessobjects.sdk set to ERROR 08/03/19 04:33:55 log4j: Parsing appender named CE1. ... I am also seeing Could not find root logger information. Shouldn't log4j.rootLogger=DEBUG,fileAppend do the trick? Thanks, Mustafa Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Could not find root logger information Is this OK?
I am not quite shure about property configuration (I work always with xml). But I suspect that the double configuration of the root logger (rootLogger and rootCategory) causes your problem. But the both lines rootLogger and rootCategory means the same. The use of the term Category is deprecated and replaced by the term Logger. Heri -Original Message- From: Mustafa Cayci [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 10:51 AM To: log4j-user@logging.apache.org Subject: Could not find root logger information Is this OK? Hello, I have configured log4j in my application server. I have defined the following log4j.properties log4j.debug=true log4j.threshold=ALL log4j.rootLogger=DEBUG,fileAppend log4j.rootCategory=DEBUG,fileAppend log4j.logger.com.businessobjects.security.jaas=DEBUG log4j.logger.org.apache=ERROR log4j.appender.conAppend=org.apache.log4j.ConsoleAppender #log4j.appender.conAppend.Threshold=INFO log4j.appender.conAppend.layout=org.apache.log4j.PatternLayout log4j.appender.conAppend.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n log4j.appender.fileAppend=org.apache.log4j.RollingFileAppender log4j.appender.fileAppend.Threshold=DEBUG log4j.appender.fileAppend.File=jsr168app.log log4j.appender.fileAppend.MaxFileSize=5MB log4j.appender.fileAppend.MaxBackupIndex=100 log4j.appender.fileAppend.Append=true log4j.appender.fileAppend.layout=org.apache.log4j.PatternLayout log4j.appender.fileAppend.layout.ConversionPattern=%d %-5p [%t] %-17c{2} - %m\r\n When I start my application server, I am seeing the following messages ... 08/03/19 04:33:55 log4j: Finished configuring. 08/03/19 04:33:55 log4j: Reading configuration from URL classloader:/META-INF/CrystalEnterprise.Trace/basic.properties 08/03/19 04:33:55 log4j: Could not find root logger information. Is this OK? 08/03/19 04:33:55 log4j: Parsing for [com.businessobjects.sdk] with value=[ERROR, CE1]. 08/03/19 04:33:55 log4j: Level token is [ERROR]. 08/03/19 04:33:55 log4j: Category com.businessobjects.sdk set to ERROR 08/03/19 04:33:55 log4j: Parsing appender named CE1. ... I am also seeing Could not find root logger information. Shouldn't log4j.rootLogger=DEBUG,fileAppend do the trick? Thanks, Mustafa __ __ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - 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]
logging relative to webapp context path in tomcat
Here's a little helper class for all users who want to write their webapp's log file(s) to a directory relative to the context directory without any extra configuration. A usage example is included in the javadoc comments of the class. --- package com.toolbox.log4j; import java.io.File; import org.apache.log4j.Appender; import org.apache.log4j.Category; import org.apache.log4j.FileAppender; import org.apache.log4j.LogManager; import org.apache.log4j.spi.HierarchyEventListener; /** * Helper class used to configure log4j file appenders with a path that * is computed at runtime. Initially implemented to enable logging to * a context-relative location when running in a web container like tomcat. * * pUsage example:/p * * Use a relative filename in the log4j configuration. * pre * log4j.rootCategory=ERROR, WEBAPP * log4j.appender.WEBAPP=org.apache.log4j.DailyRollingFileAppender * log4j.appender.WEBAPP.File=logs/webapp.log * (Rest of configuration omited.) * /pre * * Use the configurator in your initialization code like this: * pre * final String path = config.getServletContext().getRealPath(/WEB-INF); * * new LogDirectoryConfigurator(path) { * @Override * protected void doConfigure() { * PropertiesConfigurator.configure(path + /log4j.properties); * } * }.configure(); * /pre * * The logfile will be created as tt/WEB-INF/logs/webapp.log/tt. * * @author fischer * @version $Revision: 1.0 $ $Date: 2007/06/26 11:00:50 $ */ public abstract class LogDirectoryConfigurator implements HierarchyEventListener { private final File directory; /** * Creates a new [EMAIL PROTECTED] LogDirectoryConfigurator} that uses the specified * base path. * * @param basePath the base path. */ public LogDirectoryConfigurator(String basePath) { this(new File(basePath)); } /** * Creates a new [EMAIL PROTECTED] LogDirectoryConfigurator} that uses the * base directory represented by the specified file. * * @param baseDirectory the base directory. */ public LogDirectoryConfigurator(File baseDirectory) { this.directory = baseDirectory; } /** * Performs the configuration of the log4j system. * * @see #doConfigure() */ public void configure() { LogManager.getLoggerRepository().addHierarchyEventListener(this); doConfigure(); } /** * Scans the configuration of the specified appender. If the configured * filename denotes a relative path, the appender is re-configured to * write to the absolute path ttlt;base directorygt * lt;relative pathgt;/tt. * * @param category [EMAIL PROTECTED] * @param appender [EMAIL PROTECTED] */ public void addAppenderEvent(Category category, Appender appender) { if (! (appender instanceof FileAppender)) return; FileAppender fileAppender = (FileAppender) appender; File file = new File(fileAppender.getFile()); if (file.isAbsolute()) return; String relativePath = fileAppender.getFile(); String absolutePath = new File(directory, relativePath).getAbsolutePath(); fileAppender.setFile(absolutePath); } /** * [EMAIL PROTECTED] */ public void removeAppenderEvent(Category category, Appender appender) { // Intentionally left empty. } /** * Implement this method to read the log4j configuration. All relative * paths configured for any [EMAIL PROTECTED] FileAppender} are prefixed with * the base directory. */ protected abstract void doConfigure(); } -- GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Could not find root logger information Is this OK?
Hi, It looks like log4j may be picking up the wrong config file (unless you've got some mechanism in place to configure log4j additively from multiple files). It's configuring itself from: [some-jar-or-dir]/META-INF/CrystalEnterprise.Trace/basic.properties which apparently does NOT have a log4j.rootLogger/.rootCategory property set. That's why the message appears in the output. (As mentioned previously, these properties are redundant; but I think setting both is harmless). Are all the messages being logged to jsr168app.log? The debug output should also have messages like this: 08/03/19 04:33:55 log4j: Parsing for [com.businessobjects.security.jaas] with value=[DEBUG, fileAppend]. 08/03/19 04:33:55 log4j: Level token is [DEBUG]. 08/03/19 04:33:55 log4j: Category com.businessobjects.security.jaas set to DEBUG 08/03/19 04:33:55 log4j: Parsing appender named fileAppend. If not, then it's definitely not configuring itself properly. On Wednesday 19 March 2008 5:50 am, Mustafa Cayci wrote: Hello, I have configured log4j in my application server. I have defined the following log4j.properties log4j.debug=true log4j.threshold=ALL log4j.rootLogger=DEBUG,fileAppend log4j.rootCategory=DEBUG,fileAppend log4j.logger.com.businessobjects.security.jaas=DEBUG log4j.logger.org.apache=ERROR log4j.appender.conAppend=org.apache.log4j.ConsoleAppender #log4j.appender.conAppend.Threshold=INFO log4j.appender.conAppend.layout=org.apache.log4j.PatternLayout log4j.appender.conAppend.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n log4j.appender.fileAppend=org.apache.log4j.RollingFileAppender log4j.appender.fileAppend.Threshold=DEBUG log4j.appender.fileAppend.File=jsr168app.log log4j.appender.fileAppend.MaxFileSize=5MB log4j.appender.fileAppend.MaxBackupIndex=100 log4j.appender.fileAppend.Append=true log4j.appender.fileAppend.layout=org.apache.log4j.PatternLayout log4j.appender.fileAppend.layout.ConversionPattern=%d %-5p [%t] %-17c{2} - %m\r\n When I start my application server, I am seeing the following messages ... 08/03/19 04:33:55 log4j: Finished configuring. 08/03/19 04:33:55 log4j: Reading configuration from URL classloader:/META-INF/CrystalEnterprise.Trace/basic.properties 08/03/19 04:33:55 log4j: Could not find root logger information. Is this OK? 08/03/19 04:33:55 log4j: Parsing for [com.businessobjects.sdk] with value=[ERROR, CE1]. 08/03/19 04:33:55 log4j: Level token is [ERROR]. 08/03/19 04:33:55 log4j: Category com.businessobjects.sdk set to ERROR 08/03/19 04:33:55 log4j: Parsing appender named CE1. ... I am also seeing Could not find root logger information. Shouldn't log4j.rootLogger=DEBUG,fileAppend do the trick? Thanks, Mustafa ___ _ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Absolute security comes with chains. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Could not find root logger information Is this OK?
Hello Tim, Yes that was the case. I was reading the output and noticed that ../Crys../basic.properties and found out that that file was not using rootCategory. I removed that file from the library and restarted my application server and worked. Thanks, Mustafa - Original Message From: Tim Watts [EMAIL PROTECTED] To: log4j-user@logging.apache.org Sent: Wednesday, March 19, 2008 9:55:50 AM Subject: Re: Could not find root logger information Is this OK? Hi, It looks like log4j may be picking up the wrong config file (unless you've got some mechanism in place to configure log4j additively from multiple files). It's configuring itself from: [some-jar-or-dir]/META-INF/CrystalEnterprise.Trace/basic.properties which apparently does NOT have a log4j.rootLogger/.rootCategory property set. That's why the message appears in the output. (As mentioned previously, these properties are redundant; but I think setting both is harmless). Are all the messages being logged to jsr168app.log? The debug output should also have messages like this: 08/03/19 04:33:55 log4j: Parsing for [com.businessobjects.security.jaas] with value=[DEBUG, fileAppend]. 08/03/19 04:33:55 log4j: Level token is [DEBUG]. 08/03/19 04:33:55 log4j: Category com.businessobjects.security.jaas set to DEBUG 08/03/19 04:33:55 log4j: Parsing appender named fileAppend. If not, then it's definitely not configuring itself properly. On Wednesday 19 March 2008 5:50 am, Mustafa Cayci wrote: Hello, I have configured log4j in my application server. I have defined the following log4j.properties log4j.debug=true log4j.threshold=ALL log4j.rootLogger=DEBUG,fileAppend log4j.rootCategory=DEBUG,fileAppend log4j.logger.com.businessobjects.security.jaas=DEBUG log4j.logger.org.apache=ERROR log4j.appender.conAppend=org.apache.log4j.ConsoleAppender #log4j.appender.conAppend.Threshold=INFO log4j.appender.conAppend.layout=org.apache.log4j.PatternLayout log4j.appender.conAppend.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n log4j.appender.fileAppend=org.apache.log4j.RollingFileAppender log4j.appender.fileAppend.Threshold=DEBUG log4j.appender.fileAppend.File=jsr168app.log log4j.appender.fileAppend.MaxFileSize=5MB log4j.appender.fileAppend.MaxBackupIndex=100 log4j.appender.fileAppend.Append=true log4j.appender.fileAppend.layout=org.apache.log4j.PatternLayout log4j.appender.fileAppend.layout.ConversionPattern=%d %-5p [%t] %-17c{2} - %m\r\n When I start my application server, I am seeing the following messages ... 08/03/19 04:33:55 log4j: Finished configuring. 08/03/19 04:33:55 log4j: Reading configuration from URL classloader:/META-INF/CrystalEnterprise.Trace/basic.properties 08/03/19 04:33:55 log4j: Could not find root logger information. Is this OK? 08/03/19 04:33:55 log4j: Parsing for [com.businessobjects.sdk] with value=[ERROR, CE1]. 08/03/19 04:33:55 log4j: Level token is [ERROR]. 08/03/19 04:33:55 log4j: Category com.businessobjects.sdk set to ERROR 08/03/19 04:33:55 log4j: Parsing appender named CE1. ... I am also seeing Could not find root logger information. Shouldn't log4j.rootLogger=DEBUG,fileAppend do the trick? Thanks, Mustafa ___ _ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Absolute security comes with chains. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Adding a custom variable to Log4j logging calls
Hi Everyone I am newbi with log4j , i was wondering if there is any example code on how to add a custom variable to a log4j logging call. the default is log.log(DEBUG,log message); I would like to add another custom variable here to allow for some additional information. so the new log call will be log.log(DEBUG,log message,more info); Thanks Derek -- View this message in context: http://www.nabble.com/Adding-a-custom-variable-to-Log4j-logging-calls-tp16145549p16145549.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Suppressing stacktrace output
Hi- I've defined two appenders for my application: a console and a file appender. Throughout my code I've been using the convention of logging a message along with a throwable so that I could output the stacktrace for diagnostic purposes. I'd like to suppress the stacktrace output for the console appender but can't find any way to do that that allows me to keep all my logging statements as is. I found one unacceptable workaround where, for each logged exception I could do the following: log.info(Some custom message); log.debug(Some custom message, e); and then set up appropriate filter levels on each appender. Does someone have a solution that would allow me to simply turn off stacktrace output for a specific appender? Thanks, Jim -- View this message in context: http://www.nabble.com/Suppressing-stacktrace-output-tp16145551p16145551.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using InputStream as message
I'm considering using log4j in order to log data that I receive as a backup to a single file (DailyRollingFileAppender). I plan on receiving the file into a temp file, and then using that as both the source for the log and my processing. However I'd like to avoid having to read all the data into memory in order to log it through log4j. I was poking around, and I don't think this functionality currently exists. I was looking for a bit of guidance on how to add a way to do this. I was looking at adding a renderer in org.apache.log4j.or, but the problem is it would require reading the whole file into memory. Would I need to extend/re-implement an Appender? The problem is I want to keep the entire file as a single log entry in the log file, but don't want to read the file into memory. Any ideas? --Aaron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Suppressing stacktrace output
I think the layout determines if the stack trace is logged. How are you configuring the console appender? On Wed, Mar 19, 2008 at 9:58 AM, jimski [EMAIL PROTECTED] wrote: Hi- I've defined two appenders for my application: a console and a file appender. Throughout my code I've been using the convention of logging a message along with a throwable so that I could output the stacktrace for diagnostic purposes. I'd like to suppress the stacktrace output for the console appender but can't find any way to do that that allows me to keep all my logging statements as is. I found one unacceptable workaround where, for each logged exception I could do the following: log.info(Some custom message); log.debug(Some custom message, e); and then set up appropriate filter levels on each appender. Does someone have a solution that would allow me to simply turn off stacktrace output for a specific appender? Thanks, Jim -- View this message in context: http://www.nabble.com/Suppressing-stacktrace-output-tp16145551p16145551.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A. N. 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]
Re: Adding a custom variable to Log4j logging calls
Is there a reason why appending the strings doesn't work? I think you can use format messages. On Wed, Mar 19, 2008 at 9:57 AM, dertown [EMAIL PROTECTED] wrote: Hi Everyone I am newbi with log4j , i was wondering if there is any example code on how to add a custom variable to a log4j logging call. the default is log.log(DEBUG,log message); I would like to add another custom variable here to allow for some additional information. so the new log call will be log.log(DEBUG,log message,more info); Thanks Derek -- View this message in context: http://www.nabble.com/Adding-a-custom-variable-to-Log4j-logging-calls-tp16145549p16145549.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A. N. 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]
How do I start Chainsaw without extra tabs
Hi, I have created a startup config file that loads the receivers for my log files.this is working great. I would like to start Chainsaw without the application creating a chainsaw-log tab, Zeroconf tab, or the Welcome tab. I really don't need these tabs as we would like to use this to only view the log files from our app. We do not want, or need, to view any other log files. Can this be done? I know I can right-click and select Hide, but we would much rather start without the tab ever being created. Additionally, I am unable to even hide the Zeroconf or Welcome tabs as the Hide option is disabled on them. Thanks, Dave
RE: How do I start Chainsaw without extra tabs
I'm not sure how to prevent the zeroconf tab from being created (other than not having zeroconf dependencies in your Chainsaw classpath). The Welcome tab visibility is a remembered preference in Chainsaw SVN trunk (not yet released version of Chainsaw). You can prevent the chainsaw-log tab from being created by adding an 'org.apache.log4j' LOGGER entry to your Chainsaw log4j config file which sets the level to ERROR (or OFF). Scott Deboy COMOTIV SYSTEMS 111 SW Columbia Street Ste. 950 Portland, OR 97201 Telephone: 503.224.7496 Cell: 503.997.1367 Fax:503.222.0185 [EMAIL PROTECTED] www.comotivsystems.com -Original Message- From: Dave Hensley [mailto:[EMAIL PROTECTED] Sent: Wed 3/19/2008 5:17 PM To: log4j-user@logging.apache.org Subject: How do I start Chainsaw without extra tabs Hi, I have created a startup config file that loads the receivers for my log files.this is working great. I would like to start Chainsaw without the application creating a chainsaw-log tab, Zeroconf tab, or the Welcome tab. I really don't need these tabs as we would like to use this to only view the log files from our app. We do not want, or need, to view any other log files. Can this be done? I know I can right-click and select Hide, but we would much rather start without the tab ever being created. Additionally, I am unable to even hide the Zeroconf or Welcome tabs as the Hide option is disabled on them. Thanks, Dave