Multiple loggers
I was wondering what syntax is to declare multiple loggers on the the properties file? And how I would get that logger in my application! Thank you! _ Powerful Parental Controls Let your child discover the best the Internet has to offer. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom levels.
lol I know about SMTP appender am using it already, but am taking about create a custom level and send SMTP when that specific level is logged... I already have a logger setup to send e-mails when FATAL errors occur. But I also want to send e-mail on some specific occasions ;) Like starting and stopping an application. To do this I need to define a custom level. The problem is that the samples provided for the custom level dont offer any explanation on how to implement the logger class. Unless there is a better way? From: Ivan Jouikov [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: 'Log4J Users List' [EMAIL PROTECTED] Subject: RE: Custom levels. Date: Thu, 7 Oct 2004 21:53:39 -0700 http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Thursday, October 07, 2004 1:51 PM To: [EMAIL PROTECTED] Subject: Custom levels. So far I have log4j setup that INFo logs get logged to a rolling file and fatal logs sent by e-mail. Now I would like to to my application the ability to send an e-mail when it has satrted and stopped I was thinking I could this be creating a custom level. Is there a better way? If not I have already extended the Level class, but the sample source does not show how to use the custom level... How can I use my custom level? Thanks _ Powerful Parental Controls Let your child discover the best the Internet has to offer. http://join.msn.com/?pgmarket=en- capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_ MSNIS_Taglines Start enjoying all the benefits of MSN- Premium right now and get the first two months FREE*. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.772 / Virus Database: 519 - Release Date: 01.10.2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.772 / Virus Database: 519 - Release Date: 01.10.2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Designer Mail isn't just fun to send, it's fun to receive. Use special stationery, fonts and colors. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom levels.
-Original Message- From: None None [mailto:[EMAIL PROTECTED] I already have a logger setup to send e-mails when FATAL errors occur. But I also want to send e-mail on some specific occasions ;) Like starting and stopping an application. To do this I need to define a custom level. The problem is that the samples provided for the custom level dont offer any explanation on how to implement the logger class. Unless there is a better way? Hi, I was starting doing a custom level but then I preferred the more light approach suggested from Yoav Shapira some time ago on this list. For me was perfect. Here there is the message: -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, September 17, 2004 1:59 PM To: Log4J Users List Subject: RE: Custom Levels Hi, I can't help with your actual problem, as I don't know its cause, but I wanted to offer an alternative approach that involves much less work for you. Use an Admin Logger as a separate Logger, rather than a separate level. Have a Singleton in your webapp which has private static final Logger ADMIN_LOGGER = Logger.getLogger(MYAPP_ADMIN_LOGGER); public static Logger getAdminLogger() { return ADMIN_LOGGER; } or maybe public static void warnAdmin(...) { ADMIN_LOGGER.warn(...); } etc. The main advantage of this approach is that you don't need to write a custom Level, a custom Logger, or a LoggerFactory. In addition, you still maintain clean separation of logging output for admin from other logging output. You can still configure whatever appenders (and thresholds, and renders, etc.) you want just for the admin logger. All your classes can access it with negligible overhead via the singleton. Much simpler, more streamlined than your approach, I think. But it's just a suggestion, feel free to ignore it ;) Yoav Shapira Millennium Research Informatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom levels.
Hey I found that as well... But I managed to make it work. It would help to say that the subclass folder in the samples is for the logger and that mycat.good is the properties file lol I I like the logger method because it is losely coupled from the app. Anyways it's all good... I need to understand how the levels work though... In MyLevel class I have... static public final int MANAGEMENT_INT = Level.FATAL_INT + 1; private static String MANAGEMENT_STR = MANAGEMENT; public static final XLevel MANAGEMENT = new XLevel(MANAGEMENT_INT, MANAGEMENT_STR, 0); What's the 3rd parameter for, the 0 (Zero) Now I will explain the situation once more, so we understand each other and see why this is happening. ;) I want my application that every time it starts/stops that it sends an e-mail. All INFO to go to a rolling file and all FATAL exceptions to e-mail. So I have my properties file as follows... log4j.rootLogger = INFO, file, mail log4j.appender.file= org.apache.log4j.RollingFileAppender log4j.appender.file.Threshold = INFO log4j.appender.file.File = logs.txt log4j.appender.file.MaxFileSize = 2KB log4j.appender.file.MaxBackupIndex = 5 log4j.appender.file.layout = org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern = %-4r %-5p [%t] %37c %3x - %m%n log4j.appender.mail = org.apache.log4j.net.SMTPAppender log4j.appender.mail.Threshold = FATAL log4j.appender.mail.SMTPHost = SOMESERVER log4j.appender.mail.From = TMI.TestLogs log4j.appender.mail.To = [EMAIL PROTECTED] log4j.appender.mail.Subject = Application Exception log4j.appender.mail.layout = org.apache.log4j.PatternLayout log4j.appender.mail.layout.ConversionPattern = %-4r %-5p [%t] %37c %3x - %m%n Notice for now am not handeling the MANAGEMENT level I want In MyLogger class I have written a management method that handles the new level I created. If you noticed above I set the new level to INT_FATAL + 1. The problem now is when ever I write a MANAGEMENT message I get an e-mail, even though I set the appenders threshhold to FATAL. If I configure another smtp appender for MANAGEMENT every time I write a MANAGEMEN message I will get 2 e-mails. Thanks From: DE BENEDICTIS DAVIDE [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: Custom levels. Date: Fri, 8 Oct 2004 15:48:24 +0200 -Original Message- From: None None [mailto:[EMAIL PROTECTED] I already have a logger setup to send e-mails when FATAL errors occur. But I also want to send e-mail on some specific occasions ;) Like starting and stopping an application. To do this I need to define a custom level. The problem is that the samples provided for the custom level dont offer any explanation on how to implement the logger class. Unless there is a better way? Hi, I was starting doing a custom level but then I preferred the more light approach suggested from Yoav Shapira some time ago on this list. For me was perfect. Here there is the message: -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, September 17, 2004 1:59 PM To: Log4J Users List Subject: RE: Custom Levels Hi, I can't help with your actual problem, as I don't know its cause, but I wanted to offer an alternative approach that involves much less work for you. Use an Admin Logger as a separate Logger, rather than a separate level. Have a Singleton in your webapp which has private static final Logger ADMIN_LOGGER = Logger.getLogger(MYAPP_ADMIN_LOGGER); public static Logger getAdminLogger() { return ADMIN_LOGGER; } or maybe public static void warnAdmin(...) { ADMIN_LOGGER.warn(...); } etc. The main advantage of this approach is that you don't need to write a custom Level, a custom Logger, or a LoggerFactory. In addition, you still maintain clean separation of logging output for admin from other logging output. You can still configure whatever appenders (and thresholds, and renders, etc.) you want just for the admin logger. All your classes can access it with negligible overhead via the singleton. Much simpler, more streamlined than your approach, I think. But it's just a suggestion, feel free to ignore it ;) Yoav Shapira Millennium Research Informatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Express yourself instantly with MSN Messenger! Download today - it's FREE! hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dummy://log4j.dtd (log4j problem in Oracle 10gAS)
Where are you loading this log4j.xml from?. Does Oracle provide some kind of StartUp class (like WebSphere and Weblogic, where the container calls this class beforer it loads the application)?. where do you have the log4j.jar?, is it in META-INF/lib directory?. thanks Srini -Original Message- From: Zhong Lun [mailto:[EMAIL PROTECTED] Sent: Friday, October 08, 2004 9:28 AM To: [EMAIL PROTECTED] Subject: dummy://log4j.dtd (log4j problem in Oracle 10gAS) Hi, Wonder who has log4j.xml experience in EJB environment? I tried on Oracle 10gAS on Windows (the iAS version actually is still 9.0.4.2), my log4j initilization code looks like: InputStream inStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(sLogF ileName); new DOMConfigurator().doConfigure(inStream, LogManager.getLoggerRepository()); There is no problem to load the log4j.xml however the application server complains the log4j.dtd: 04/10/08 18:48:18 Start process 04/10/08 18:48:33 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0) initialized 04/10/08 18:49:09 log4j:ERROR Parsing error on line 0 and column 0 04/10/08 18:49:09 log4j:ERROR File dummy://log4j.dtd not found. 04/10/08 18:49:09 log4j:ERROR Could not parse input source [EMAIL PROTECTED] 04/10/08 18:49:09 org.xml.sax.SAXException: Stopping after fatal error: File dummy://log4j.dtd not found. 04/10/08 18:49:09 at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1245) 04/10/08 18:49:09 at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument( DefaultEntityHandler.java:501) 04/10/08 18:49:09 at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:314) 04/10/08 18:49:09 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097) 04/10/08 18:49:09 at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.jav a:195) 04/10/08 18:49:09 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:66 5) 04/10/08 18:49:09 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:61 6) I check DOMConfiguration.java, it contains: docBuilder.setErrorHandler(new SAXErrorHandler()); docBuilder.setEntityResolver(new Log4jEntityResolver()); // we change the system ID to a valid URI so that Crimson won't // complain. Indeed, log4j.dtd alone is not a valid URI which // causes Crimson to barf. The Log4jEntityResolver only cares // about the log4j.dtd ending. inputSource.setSystemId(dummy://log4j.dtd); Document doc = docBuilder.parse(inputSource); parse(doc.getDocumentElement()); Anybody has an idea and help me, thanks in advance. Regards - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dummy://log4j.dtd (log4j problem in Oracle 10gAS)
The way I have done is..(at least in WebSphere). The WebSphere provides a StartUp class that is guaranteed to be called by the EJB Container before it loads the application ear file. so in my start up class, I tried to load the configuration file (by providing Url) and I package the log4j.jar file as part of my ear file. it worked quite well for me thanks Srini -Original Message- From: Zhong Lun [mailto:[EMAIL PROTECTED] Sent: Friday, October 08, 2004 9:28 AM To: [EMAIL PROTECTED] Subject: dummy://log4j.dtd (log4j problem in Oracle 10gAS) Hi, Wonder who has log4j.xml experience in EJB environment? I tried on Oracle 10gAS on Windows (the iAS version actually is still 9.0.4.2), my log4j initilization code looks like: InputStream inStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(sLogF ileName); new DOMConfigurator().doConfigure(inStream, LogManager.getLoggerRepository()); There is no problem to load the log4j.xml however the application server complains the log4j.dtd: 04/10/08 18:48:18 Start process 04/10/08 18:48:33 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0) initialized 04/10/08 18:49:09 log4j:ERROR Parsing error on line 0 and column 0 04/10/08 18:49:09 log4j:ERROR File dummy://log4j.dtd not found. 04/10/08 18:49:09 log4j:ERROR Could not parse input source [EMAIL PROTECTED] 04/10/08 18:49:09 org.xml.sax.SAXException: Stopping after fatal error: File dummy://log4j.dtd not found. 04/10/08 18:49:09 at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1245) 04/10/08 18:49:09 at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument( DefaultEntityHandler.java:501) 04/10/08 18:49:09 at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:314) 04/10/08 18:49:09 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097) 04/10/08 18:49:09 at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.jav a:195) 04/10/08 18:49:09 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:66 5) 04/10/08 18:49:09 at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:61 6) I check DOMConfiguration.java, it contains: docBuilder.setErrorHandler(new SAXErrorHandler()); docBuilder.setEntityResolver(new Log4jEntityResolver()); // we change the system ID to a valid URI so that Crimson won't // complain. Indeed, log4j.dtd alone is not a valid URI which // causes Crimson to barf. The Log4jEntityResolver only cares // about the log4j.dtd ending. inputSource.setSystemId(dummy://log4j.dtd); Document doc = docBuilder.parse(inputSource); parse(doc.getDocumentElement()); Anybody has an idea and help me, thanks in advance. Regards - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Log4J configuration for library
Hi I'm developing a library and I'm using Log4J. I've had problems with applications that use the library and use log4j at the same time. For some reason the configuration gets messed up. I'm using a log4j.properties file inside de .jar library. Is there a correct way to configure log4j for libraries? Regards, Néstor Boscán - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J configuration for library
Hi, First, please be more specific than just the configuration gets messed up. Our ability to help you is mostly limited by the quality and quantity of the information you provide. The common problem when developing libraries is the need to allow the user of the library to configure its logging. There is code on the log4j wiki that shows you how to check if log4j has already been configured. You can do this check, and then either throw a (possibly fatal) exception if log4j is not configured, or configure it yourself. This is a fairly safe approach. Yoav Shapira Millennium Research Informatics -Original Message- From: Nestor Boscan [mailto:[EMAIL PROTECTED] Sent: Friday, October 08, 2004 2:26 PM To: [EMAIL PROTECTED] Subject: Log4J configuration for library Hi I'm developing a library and I'm using Log4J. I've had problems with applications that use the library and use log4j at the same time. For some reason the configuration gets messed up. I'm using a log4j.properties file inside de .jar library. Is there a correct way to configure log4j for libraries? Regards, Néstor Boscán - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SMTPAppender only for ERROR and FATAL?
Javadoc here: http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html If you are not providing an EvaluatorClass param you are using the default evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:02 PM To: [EMAIL PROTECTED] Cc: Subject:SMTPAppender only for ERROR and FATAL? Am trying to set up a logger so I can send e-mails on speciffic events. Though it only seems an e-mail gets sent if the level is error, fatal and above. So I get my logger and call myLogger.info(bla); I get no e-mail So then I change it to myLogger.fatal(bla); and and I get an e-mail! Below is my config file ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration appender name=console class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=file class=org.apache.log4j.RollingFileAppender param name=File value=C:\\Programming\\logs.txt/ param name=MaxFileSize value=2KB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender root level value =INFO/ appender-ref ref=email/ /root /log4j:configuration _ Take charge with a pop-up guard built on patented Microsoft SmartScreen Technology. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN Premium right now and get the first two months FREE*. - 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: SMTPAppender only for ERROR and FATAL?
So according to that I have to appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=EvaluatorClass value=/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender What do I put for the value? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:27:01 -0700 Javadoc here: http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html If you are not providing an EvaluatorClass param you are using the default evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:02 PM To: [EMAIL PROTECTED] Cc: Subject:SMTPAppender only for ERROR and FATAL? Am trying to set up a logger so I can send e-mails on speciffic events. Though it only seems an e-mail gets sent if the level is error, fatal and above. So I get my logger and call myLogger.info(bla); I get no e-mail So then I change it to myLogger.fatal(bla); and and I get an e-mail! Below is my config file ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration appender name=console class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=file class=org.apache.log4j.RollingFileAppender param name=File value=C:\\Programming\\logs.txt/ param name=MaxFileSize value=2KB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender root level value =INFO/ appender-ref ref=email/ /root /log4j:configuration _ Take charge with a pop-up guard built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - 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] _ MSN® Calendar keeps you organized and takes the effort out of scheduling get-togethers. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SMTPAppender only for ERROR and FATAL?
The fully qualfied class name of an evaluator that you provide. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:43 PM To: [EMAIL PROTECTED] Cc: Subject:RE: SMTPAppender only for ERROR and FATAL? So according to that I have to appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=EvaluatorClass value=/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender What do I put for the value? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:27:01 -0700 Javadoc here: http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html If you are not providing an EvaluatorClass param you are using the default evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:02 PM To:[EMAIL PROTECTED] Cc: Subject: SMTPAppender only for ERROR and FATAL? Am trying to set up a logger so I can send e-mails on speciffic events. Though it only seems an e-mail gets sent if the level is error, fatal and above. So I get my logger and call myLogger.info(bla); I get no e-mail So then I change it to myLogger.fatal(bla); and and I get an e-mail! Below is my config file ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration appender name=console class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=file class=org.apache.log4j.RollingFileAppender param name=File value=C:\\Programming\\logs.txt/ param name=MaxFileSize value=2KB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender root level value =INFO/ appender-ref ref=email/ /root /log4j:configuration _ Take charge with a pop-up guard built on patented Microsoft SmartScreen Technology. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN Premium right now and get the first two months FREE*. - 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] _ MSN Calendar keeps you organized and takes the effort out of scheduling get-togethers. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN Premium right now and get the first two months FREE*. - 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: SMTPAppender only for ERROR and FATAL?
Sorry I dont want to be stupid and I dont want to get RTFM It's the first time I use log4j what class is this? Where do I get this evaluator class name? And what does it have to do with the fact that SMTP appender only sends if the level is ERROR or FATAL? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:48:31 -0700 The fully qualfied class name of an evaluator that you provide. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:43 PM To: [EMAIL PROTECTED] Cc: Subject:RE: SMTPAppender only for ERROR and FATAL? So according to that I have to appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=EvaluatorClass value=/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender What do I put for the value? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:27:01 -0700 Javadoc here: http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html If you are not providing an EvaluatorClass param you are using the default evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:02 PM To: [EMAIL PROTECTED] Cc: Subject: SMTPAppender only for ERROR and FATAL? Am trying to set up a logger so I can send e-mails on speciffic events. Though it only seems an e-mail gets sent if the level is error, fatal and above. So I get my logger and call myLogger.info(bla); I get no e-mail So then I change it to myLogger.fatal(bla); and and I get an e-mail! Below is my config file ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration appender name=console class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=file class=org.apache.log4j.RollingFileAppender param name=File value=C:\\Programming\\logs.txt/ param name=MaxFileSize value=2KB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender root level value =INFO/ appender-ref ref=email/ /root /log4j:configuration _ Take charge with a pop-up guard built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - 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] _ MSN® Calendar keeps you organized and takes the effort out of scheduling get-togethers. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - 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] _ MSN® Calendar keeps you organized and takes the effort out of scheduling get-togethers. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.
RE: SMTPAppender only for ERROR and FATAL?
You write the evaluator yourself, include it in your classpath and specify it in the config file. Click on the link to TriggeringEventEvaluator in the SMTPAppender javadoc - that will explain. OK, here's the link: http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/TriggeringEventEvaluator.html Your evaluator is called each time an event is processed by the appender to see if the event will trigger the send of the email. The body of your TriggeringEventEvaluator could have: return true; to have SMTPAppender send an email with every event evaluated by the evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 1:00 PM To: [EMAIL PROTECTED] Cc: Subject:RE: SMTPAppender only for ERROR and FATAL? Sorry I dont want to be stupid and I dont want to get RTFM It's the first time I use log4j what class is this? Where do I get this evaluator class name? And what does it have to do with the fact that SMTP appender only sends if the level is ERROR or FATAL? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:48:31 -0700 The fully qualfied class name of an evaluator that you provide. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:43 PM To:[EMAIL PROTECTED] Cc: Subject: RE: SMTPAppender only for ERROR and FATAL? So according to that I have to appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=EvaluatorClass value=/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender What do I put for the value? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:27:01 -0700 Javadoc here: http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html If you are not providing an EvaluatorClass param you are using the default evaluator. -Original Message- From:None None [mailto:[EMAIL PROTECTED] Sent:Fri 10/8/2004 12:02 PM To: [EMAIL PROTECTED] Cc: Subject: SMTPAppender only for ERROR and FATAL? Am trying to set up a logger so I can send e-mails on speciffic events. Though it only seems an e-mail gets sent if the level is error, fatal and above. So I get my logger and call myLogger.info(bla); I get no e-mail So then I change it to myLogger.fatal(bla); and and I get an e-mail! Below is my config file ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration appender name=console class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=file class=org.apache.log4j.RollingFileAppender param name=File value=C:\\Programming\\logs.txt/ param name=MaxFileSize value=2KB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender root level value =INFO/ appender-ref ref=email/ /root /log4j:configuration _ Take charge with a pop-up guard built on patented Microsoft SmartScreen Technology. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN Premium right now and get the first two months FREE*. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For
RE: SMTPAppender only for ERROR and FATAL?
OK thanks I got! It's not that obvious! BUt I get an exception package somepackagename // My custom level. public class XLevel extends Level { static public final int MANAGEMENT_INT = Level.FATAL_INT + 1; private static String MANAGEMENT_STR = MANAGEMENT; public static final XLevel MANAGEMENT = new XLevel(MANAGEMENT_INT, MANAGEMENT_STR, 0); protected XLevel(int level, String strLevel, int syslogEquiv) { super(level, strLevel, syslogEquiv); } } // Evaluator class taken from SMTPAeppnder source code and renamed. class XEvaluator implements TriggeringEventEvaluator { public boolean isTriggeringEvent(LoggingEvent event) { // Check against custom Level return event.level.isGreaterOrEqual(XLevel.MANAGEMENT); } } In my xml config param name=EvaluatorClass value=somepackagename.XEvaluator/ log4j:ERROR Could not instantiate class [somepackagename.XEvaluator]. java.lang.IllegalAccessException: Class org.apache.log4j.helpers.OptionConverter can not access a member of class somepackagename.XEvaluator with modifiers at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57) at java.lang.Class.newInstance0(Class.java:302) at java.lang.Class.newInstance(Class.java:261) at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:319) at org.apache.log4j.net.SMTPAppender.setEvaluatorClass(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:196) at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:155) at org.apache.log4j.xml.DOMConfigurator.setParameter(DOMConfigurator.java:530) at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:182) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415) at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:384) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:783) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:584) at org.apache.log4j.xml.XMLWatchdog.doOnChange(DOMConfigurator.java:815) at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:80) at org.apache.log4j.helpers.FileWatchdog.init(FileWatchdog.java:49) at org.apache.log4j.xml.XMLWatchdog.init(DOMConfigurator.java:807) at org.apache.log4j.xml.DOMConfigurator.configureAndWatch(DOMConfigurator.java:574) at tmi.Daemon.main(Daemon.java:37) Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 13:23:40 -0700 You write the evaluator yourself, include it in your classpath and specify it in the config file. Click on the link to TriggeringEventEvaluator in the SMTPAppender javadoc - that will explain. OK, here's the link: http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/TriggeringEventEvaluator.html Your evaluator is called each time an event is processed by the appender to see if the event will trigger the send of the email. The body of your TriggeringEventEvaluator could have: return true; to have SMTPAppender send an email with every event evaluated by the evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 1:00 PM To: [EMAIL PROTECTED] Cc: Subject:RE: SMTPAppender only for ERROR and FATAL? Sorry I dont want to be stupid and I dont want to get RTFM It's the first time I use log4j what class is this? Where do I get this evaluator class name? And what does it have to do with the fact that SMTP appender only sends if the level is ERROR or FATAL? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:48:31 -0700 The fully qualfied class name of an evaluator that you provide. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:43 PM To: [EMAIL PROTECTED] Cc: Subject: RE: SMTPAppender only for ERROR and FATAL? So according to that I have to appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost
RE: SMTPAppender only for ERROR and FATAL?
Ok I got it to work. I had my Evaluator class as part of my Custom Level class. So I moved to it's own file and declared it public! From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 13:23:40 -0700 You write the evaluator yourself, include it in your classpath and specify it in the config file. Click on the link to TriggeringEventEvaluator in the SMTPAppender javadoc - that will explain. OK, here's the link: http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/TriggeringEventEvaluator.html Your evaluator is called each time an event is processed by the appender to see if the event will trigger the send of the email. The body of your TriggeringEventEvaluator could have: return true; to have SMTPAppender send an email with every event evaluated by the evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 1:00 PM To: [EMAIL PROTECTED] Cc: Subject:RE: SMTPAppender only for ERROR and FATAL? Sorry I dont want to be stupid and I dont want to get RTFM It's the first time I use log4j what class is this? Where do I get this evaluator class name? And what does it have to do with the fact that SMTP appender only sends if the level is ERROR or FATAL? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:48:31 -0700 The fully qualfied class name of an evaluator that you provide. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:43 PM To: [EMAIL PROTECTED] Cc: Subject: RE: SMTPAppender only for ERROR and FATAL? So according to that I have to appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=EvaluatorClass value=/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender What do I put for the value? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:27:01 -0700 Javadoc here: http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html If you are not providing an EvaluatorClass param you are using the default evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:02 PM To: [EMAIL PROTECTED] Cc: Subject: SMTPAppender only for ERROR and FATAL? Am trying to set up a logger so I can send e-mails on speciffic events. Though it only seems an e-mail gets sent if the level is error, fatal and above. So I get my logger and call myLogger.info(bla); I get no e-mail So then I change it to myLogger.fatal(bla); and and I get an e-mail! Below is my config file ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration appender name=console class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=file class=org.apache.log4j.RollingFileAppender param name=File value=C:\\Programming\\logs.txt/ param name=MaxFileSize value=2KB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender root level value =INFO/ appender-ref ref=email/ /root /log4j:configuration _ Take charge with a pop-up guard built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,
Thershold properti of appender.
Just to confirm... When setting the threshold value of an appender it's the value of the string defined in the level class right? So when using INFO, it's comming from INFO_STR? _ Designer Mail isn't just fun to send, it's fun to receive. Use special stationery, fonts and colors. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
chainsaw and jdk1.4 logging tool
Hey guys, I am using jdk 1.4 logging tool for logging. Now I need to use chainsaw in order to analyze my log files. I don't know where to start and what to do in order to view this log file through chainsaw.i have downloaded the chainsaw v2 tool. But am confused how do I set it to take in my jdk1.4 log file and give a GUI output. What and where do I need to make changes Do I need to change my logging.property file? If so how? Any help will be appreciated. Sarita Rana 678.728.7953 [EMAIL PROTECTED] [EMAIL PROTECTED] -Original Message- From: Scott Deboy [mailto:[EMAIL PROTECTED] Sent: Friday, October 08, 2004 4:24 PM To: Log4J Users List Subject: RE: SMTPAppender only for ERROR and FATAL? You write the evaluator yourself, include it in your classpath and specify it in the config file. Click on the link to TriggeringEventEvaluator in the SMTPAppender javadoc - that will explain. OK, here's the link: http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/Triggering EventEvaluator.html Your evaluator is called each time an event is processed by the appender to see if the event will trigger the send of the email. The body of your TriggeringEventEvaluator could have: return true; to have SMTPAppender send an email with every event evaluated by the evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 1:00 PM To: [EMAIL PROTECTED] Cc: Subject:RE: SMTPAppender only for ERROR and FATAL? Sorry I dont want to be stupid and I dont want to get RTFM It's the first time I use log4j what class is this? Where do I get this evaluator class name? And what does it have to do with the fact that SMTP appender only sends if the level is ERROR or FATAL? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:48:31 -0700 The fully qualfied class name of an evaluator that you provide. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:43 PM To:[EMAIL PROTECTED] Cc: Subject: RE: SMTPAppender only for ERROR and FATAL? So according to that I have to appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=EvaluatorClass value=/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender What do I put for the value? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:27:01 -0700 Javadoc here: http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppen der.html If you are not providing an EvaluatorClass param you are using the default evaluator. -Original Message- From:None None [mailto:[EMAIL PROTECTED] Sent:Fri 10/8/2004 12:02 PM To: [EMAIL PROTECTED] Cc: Subject: SMTPAppender only for ERROR and FATAL? Am trying to set up a logger so I can send e-mails on speciffic events. Though it only seems an e-mail gets sent if the level is error, fatal and above. So I get my logger and call myLogger.info(bla); I get no e-mail So then I change it to myLogger.fatal(bla); and and I get an e-mail! Below is my config file ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration appender name=console class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=file class=org.apache.log4j.RollingFileAppender param name=File value=C:\\Programming\\logs.txt/ param name=MaxFileSize value=2KB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%-4r %-5p [%t] %37c %3x - %m%n/ /layout /appender root level value =INFO/ appender-ref ref=email/
FW: chainsaw and jdk1.4 logging tool
FYI. -Original Message- From: Scott Deboy Sent: Fri 10/8/2004 3:06 PM To: Rana, Sarita Cc: Subject:RE: chainsaw and jdk1.4 logging tool You have three options: 1: XML-formatted text file Loading an xml-formatted file won't 'tail'. The file must be well-formed XML. To open the file, in Chainsaw, select: file-load java util 2: SocketHandler If you want to use a socketHandler to see the events live, (will correctly display jdk1.4 levels) from the 'Welcome' tab, select the 'view example receiver configuration' button and save the text as chainsaw.xml (change XMLSocketReceiver plugin's port to match your SocketHandler port). Inside Chainsaw, select: view-show application wide preferences - enter the URL of this chainsaw.xml in the 'automatic configuration URL' field - restart chainsaw 3: Text file Chainsaw can display and tail a log file generated by any logging framework using LogFilePatternReceiver, but the levels won't be recognized unless they match log4j's supported levels (unsupported levels will show up as DEBUG). Here's a link to the LogFilePatternReceiver javadoc, describing the 'logFormat' keywords: http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4j/varia/LogFilePatternReceiver.java?rev=1.19view=auto If you want to tail your log file and don't mind the levels showing up as debug, modify the below-provided xml as needed and save as chainsaw.xml. Inside Chainsaw, select: view-show application wide preferences - enter the URL of this chainsaw.xml in the 'automatic configuration URL' field - restart chainsaw ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; debug=true plugin name=logFileReceiver class=org.apache.log4j.varia.LogFilePatternReceiver param name=fileURL value=file:///c:/downloads/log4j/sample.log / param name=timestampFormat value=MMddHHmmssSSS/ param name=logFormat value=TIMESTAMP LEVEL(FILE:LINE)#CLASS,LOGGER THREAD!MESSAGE/ param name=name value=logfileReceiver / param name=tailing value=true / /plugin root level value=debug/ /root /log4j:configuration -Original Message- From: Rana, Sarita [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 2:46 PM To: Log4J Users List; Scott Deboy; [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: Subject:chainsaw and jdk1.4 logging tool Hey guys, I am using jdk 1.4 logging tool for logging. Now I need to use chainsaw in order to analyze my log files. I don't know where to start and what to do in order to view this log file through chainsaw.i have downloaded the chainsaw v2 tool. But am confused how do I set it to take in my jdk1.4 log file and give a GUI output. What and where do I need to make changes Do I need to change my logging.property file? If so how? Any help will be appreciated. Sarita Rana 678.728.7953 [EMAIL PROTECTED] [EMAIL PROTECTED] -Original Message- From: Scott Deboy [mailto:[EMAIL PROTECTED] Sent: Friday, October 08, 2004 4:24 PM To: Log4J Users List Subject: RE: SMTPAppender only for ERROR and FATAL? You write the evaluator yourself, include it in your classpath and specify it in the config file. Click on the link to TriggeringEventEvaluator in the SMTPAppender javadoc - that will explain. OK, here's the link: http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/Triggering EventEvaluator.html Your evaluator is called each time an event is processed by the appender to see if the event will trigger the send of the email. The body of your TriggeringEventEvaluator could have: return true; to have SMTPAppender send an email with every event evaluated by the evaluator. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 1:00 PM To: [EMAIL PROTECTED] Cc: Subject:RE: SMTPAppender only for ERROR and FATAL? Sorry I dont want to be stupid and I dont want to get RTFM It's the first time I use log4j what class is this? Where do I get this evaluator class name? And what does it have to do with the fact that SMTP appender only sends if the level is ERROR or FATAL? Thanks From: Scott Deboy [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: RE: SMTPAppender only for ERROR and FATAL? Date: Fri, 8 Oct 2004 12:48:31 -0700 The fully qualfied class name of an evaluator that you provide. -Original Message- From: None None [mailto:[EMAIL PROTECTED] Sent: Fri 10/8/2004 12:43 PM To:[EMAIL PROTECTED] Cc: Subject: RE: SMTPAppender only for ERROR and FATAL? So according to that I have to appender name=email class=org.apache.log4j.net.SMTPAppender param name=SMTPHost value=SECORD/ param name=EvaluatorClass value=/ param name=From value=Application/ param name=To value=[EMAIL PROTECTED]/ param name=Subject value=Information/