Could not instantiate appender named console
Hi all, I'm running my program and I want to log program activities using log4j. First, I set the log4j to DEBUG level and to write in the file, but what is written in the file is just at INFO level. Second, I set it to write on the console and I get these errors: log4j:ERROR Could not find value for key log4j.appender.console log4j:ERROR Could not instantiate appender named console. and this is my log4j.properties file content: # Root logger option log4j.rootLogger=debug, console, file # Direct log messages to a log file log4j.appender.file=org.apache.log4j.FileAppender log4j.appender.file.Threshold=DEBUG log4j.appender.file.File=C:\\logfile.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n # Direct log messages to stdout log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.console.Threshold=DEBUG log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=[%t:%p] %c: %m%n log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n Does anyone have any idea? Regards, Hamed -- View this message in context: http://old.nabble.com/Could-not-instantiate-appender-named-%22console%22-tp29987859p29987859.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender
Jacob, What you are suggesting can be done using the XML itself ? I think this new appender is required due to the limitation in associating an individual logger with its own file. Thanks, Mohan -- View this message in context: http://old.nabble.com/Multiple-log-files%2C-multiple-logger-names-and-the-same-appender-tp28024737p29988016.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Allow to configure quietMode
Hello, I need to enable quietMode, especially to discard some warning messages. There exists a quietMode setter in the LogLog class, wich is never accessed, by the configurator. Is there any reason why quietMode is not configurable ? Best regards, Stephane Z. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
RE: Could not instantiate appender named console
Hamed, I believe this is the key message for you: Could not find value for key log4j.appender.console You've configured an appender named CONSOLE, but you haven't configured one named console. Case matters. Change these three lines: log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=[%t:%p] %c: %m%n to this: log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=[%t:%p] %c: %m%n and you should see better results. Ron Gallagher -Original Message- From: HJD [mailto:hamed_...@yahoo.com] Sent: Monday, October 18, 2010 2:56 AM To: log4j-user@logging.apache.org Subject: Could not instantiate appender named console Hi all, I'm running my program and I want to log program activities using log4j. First, I set the log4j to DEBUG level and to write in the file, but what is written in the file is just at INFO level. Second, I set it to write on the console and I get these errors: log4j:ERROR Could not find value for key log4j.appender.console log4j:ERROR Could not instantiate appender named console. and this is my log4j.properties file content: # Root logger option log4j.rootLogger=debug, console, file # Direct log messages to a log file log4j.appender.file=org.apache.log4j.FileAppender log4j.appender.file.Threshold=DEBUG log4j.appender.file.File=C:\\logfile.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n # Direct log messages to stdout log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.console.Threshold=DEBUG log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=[%t:%p] %c: %m%n log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n Does anyone have any idea? Regards, Hamed -- View this message in context: http://old.nabble.com/Could-not-instantiate-appender-named-%22console%22 -tp29987859p29987859.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender
Depends how many individual loggers you are concerned with. If there are, say, 3 named loggers, then just create 3 appenders; one for each logger. However, if the number of logger names cannot be known at build time, then you will probably need a custom appender that you assign to some base logger name. For each logger that sends info to the appender, the appender can evaluate whether to write it to an existing log file or create a new one. Jake On Mon, 18 Oct 2010 00:34:42 -0700 (PDT) Mohan.Radhakrishnan moh...@fss.co.in wrote: Jacob, What you are suggesting can be done using the XML itself ? I think this new appender is required due to the limitation in associating an individual logger with its own file. Thanks, Mohan -- View this message in context: http://old.nabble.com/Multiple-log-files%2C-multiple-logger-names-and-the-same-appender-tp28024737p29988016.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org