Re: How to filter specific characters to not to log
Thanks Bender/Curt. I have fixed this issue by reading byte value for each control character if any and replacing with space. i.e. All the control chars fall under range (0 - 32) byte. so that it cant break the xml report. It is working fine :-) Thanks Regards, --Praveen On 9/20/06, Bender Heri [EMAIL PROTECTED] wrote: A common way to enter binary data in xml is - use base64 encoding (not readable for humans, size is one third bigger than original) - translate to hex string (readable for humans, size is twice as big than original) Heri -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 19, 2006 8:03 PM To: Log4J Users List Subject: [SPAM (Bayesain Analysis)] - Re: How to filter specific characters to not to log - Bayesian Filter detected spam Hi Curt, We are facing problems with this chatacter #0; issue, Is there any standard convention for representing a character of value 0 in XML (and other control characters)? I understand that we can't actually *have* such a character - that's why #0; is illegal - but sometimes we want to output data that includes such characters. or How to escape these characters in xml report. Regards, Praveen On 9/19/06, Curt Arnold [EMAIL PROTECTED] wrote: XMLLayout in both 1.2 and 1.3 can produce bad XML in several scenarios as reported in bugs 29244, 34875 and 37560. Since I was an XML guru in a former life, I know of additional holes in the implementation. If you'd be interested in testing it, I could take a shot at re-implementing XMLLayout. I think that would be a better solution than trying to filter content to avoid the bugs. On Sep 18, 2006, at 1:09 PM, Praveen Kumar Hasthalapuram wrote: Hi, We will get these characters from the devices and these data we will log. These logged data will be used to generate xml reports. With some devices we are getting some control characters (some spl symbols) and these are causing xml report to fail. Is it possible to strip this characters or filter this types of characters. Regards, Praveen - 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: How to filter specific characters to not to log
Hi Curt, We are facing problems with this chatacter #0; issue, Is there any standard convention for representing a character of value 0 in XML (and other control characters)? I understand that we can't actually *have* such a character - that's why #0; is illegal - but sometimes we want to output data that includes such characters. or How to escape these characters in xml report. Regards, Praveen On 9/19/06, Curt Arnold [EMAIL PROTECTED] wrote: XMLLayout in both 1.2 and 1.3 can produce bad XML in several scenarios as reported in bugs 29244, 34875 and 37560. Since I was an XML guru in a former life, I know of additional holes in the implementation. If you'd be interested in testing it, I could take a shot at re-implementing XMLLayout. I think that would be a better solution than trying to filter content to avoid the bugs. On Sep 18, 2006, at 1:09 PM, Praveen Kumar Hasthalapuram wrote: Hi, We will get these characters from the devices and these data we will log. These logged data will be used to generate xml reports. With some devices we are getting some control characters (some spl symbols) and these are causing xml report to fail. Is it possible to strip this characters or filter this types of characters. Regards, Praveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to filter specific characters to not to log
Hi, I want to filter some specific characters (special chars) , so that it should not log. Can anyone suggest me how to it? Thanks, Praveen
Re: How to filter specific characters to not to log
Hi, We will get these characters from the devices and these data we will log. These logged data will be used to generate xml reports. With some devices we are getting some control characters (some spl symbols) and these are causing xml report to fail. Is it possible to strip this characters or filter this types of characters. Regards, Praveen On 9/18/06, Bender Heri [EMAIL PROTECTED] wrote: Can you explain where these characters occur? Are they within a String supplied as msg argument in log calls? Or where? Heri -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Monday, September 18, 2006 4:02 PM To: log4j-user@logging.apache.org Subject: [SPAM (Bayesain Analysis)] - How to filter specific characters to not to log - Bayesian Filter detected spam Hi, I want to filter some specific characters (special chars) , so that it should not log. Can anyone suggest me how to it? Thanks, Praveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Backup files are not created
Yes, did changes as you said. No change :-( Thanks, Praveen On 3/8/06, Philip Denno [EMAIL PROTECTED] wrote: Configuration looks OK. You might try removing the line: param name=Append value=true/ And also change the line: priority value=all/ To level value=DEBUG/ And see if that changes the behaviour. Cheers, Philip. -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 9:55 AM To: Log4J Users List Subject: Re: Backup files are not created Yes, it exits. Able to log into /log/file1.log Thanks, - Praveen On 3/8/06, Philip Denno [EMAIL PROTECTED] wrote: Does /log exist? Cheers, Philip. -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 8:22 AM To: log4j-user@logging.apache.org Subject: Backup files are not created Hi , Eventhough i have given value for MaxBackupIndex to 10, it is not creating backup files. What could be the problem? Anything wrong with the configuration? This is sample configuration: appender name=APP class=org.apache.log4j.RollingFileAppender param name=File value=/log/file1.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{dd-MMM- HH:mm:ss} %p %m%n/ /layout /appender category name=LOGGER priority value=all/ appender-ref ref=APP/ /category Thanks, Praveen - 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: Backup files are not created
Yes. Even i have reduced the size to 1000KB and tried. same result.. Thanks, --Praveen On 3/9/06, Javier Gonzalez [EMAIL PROTECTED] wrote: Are you sure you are hitting the 10MB log file size? On 3/9/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Yes, did changes as you said. No change :-( Thanks, Praveen On 3/8/06, Philip Denno [EMAIL PROTECTED] wrote: Configuration looks OK. You might try removing the line: param name=Append value=true/ And also change the line: priority value=all/ To level value=DEBUG/ And see if that changes the behaviour. Cheers, Philip. -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 9:55 AM To: Log4J Users List Subject: Re: Backup files are not created Yes, it exits. Able to log into /log/file1.log Thanks, - Praveen On 3/8/06, Philip Denno [EMAIL PROTECTED] wrote: Does /log exist? Cheers, Philip. -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 8:22 AM To: log4j-user@logging.apache.org Subject: Backup files are not created Hi , Eventhough i have given value for MaxBackupIndex to 10, it is not creating backup files. What could be the problem? Anything wrong with the configuration? This is sample configuration: appender name=APP class=org.apache.log4j.RollingFileAppender param name=File value=/log/file1.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{dd-MMM- HH:mm:ss} %p %m%n/ /layout /appender category name=LOGGER priority value=all/ appender-ref ref=APP/ /category Thanks, Praveen - 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] -- Javier González Nicolini
Backup files are not created
Hi , Eventhough i have given value for MaxBackupIndex to 10, it is not creating backup files. What could be the problem? Anything wrong with the configuration? This is sample configuration: appender name=APP class=org.apache.log4j.RollingFileAppender param name=File value=/log/file1.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{dd-MMM- HH:mm:ss} %p %m%n/ /layout /appender category name=LOGGER priority value=all/ appender-ref ref=APP/ /category Thanks, Praveen
Re: Backup files are not created
Yes, it exits. Able to log into /log/file1.log Thanks, - Praveen On 3/8/06, Philip Denno [EMAIL PROTECTED] wrote: Does /log exist? Cheers, Philip. -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 8:22 AM To: log4j-user@logging.apache.org Subject: Backup files are not created Hi , Eventhough i have given value for MaxBackupIndex to 10, it is not creating backup files. What could be the problem? Anything wrong with the configuration? This is sample configuration: appender name=APP class=org.apache.log4j.RollingFileAppender param name=File value=/log/file1.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=MaxBackupIndex value=5/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{dd-MMM- HH:mm:ss} %p %m%n/ /layout /appender category name=LOGGER priority value=all/ appender-ref ref=APP/ /category Thanks, Praveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Filtering messages with Log4j.xml
Hi, I am facing a issue with log4j.xml. I have configured filters in xml file as given below: Messages are filtered and logged into specified log file when i run from command prompt. i.e. i wrote a sample java file which will log messages. but when i ran in GUI(web) messages are not getting filtered and logged. appender name=FA class=org.apache.log4j.RollingFileAppender param name=File value=logs/sample.log/ param name=Append value=true/ param name=MaxFileSize value=1KB/ param name=MaxBackupIndex value=2/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{-MM-dd HH:mm:ss} lt;fspgt;%p %m%n/ /layout filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=Device/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ param name=cantMatchReturnValue value=neutral/ /filter filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=PING/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ param name=cantMatchReturnValue value=neutral/ /filter filter class=org.apache.log4j.varia.DenyAllFilter/ /appender What could be the problem? Thanks, Praveen
Re: Filtering messages with Log4j.xml
I have only one log4j.xml file and how can we ensure that it is loaded? In the GUI means, accessing the appliction thru IE, and when we do some operations (like updating data, deleting data or scheduling) in any module, (say module1) we are logging the what type of operation is running at particular time in that module. Just for testing purpose, i wrote one class to test at command prompt,it is working here. Thanks, -- Praveen On 2/14/06, Bender Heri [EMAIL PROTECTED] wrote: Are you shure your correct xml configuration is loaded in your GUI(web) app? BTW what you mean with GUI(web) exactly? Heri -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 2:38 PM To: log4j-user@logging.apache.org Subject: Filtering messages with Log4j.xml Hi, I am facing a issue with log4j.xml. I have configured filters in xml file as given below: Messages are filtered and logged into specified log file when i run from command prompt. i.e. i wrote a sample java file which will log messages. but when i ran in GUI(web) messages are not getting filtered and logged. appender name=FA class=org.apache.log4j.RollingFileAppender param name=File value=logs/sample.log/ param name=Append value=true/ param name=MaxFileSize value=1KB/ param name=MaxBackupIndex value=2/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{-MM-dd HH:mm:ss} lt;fspgt;%p %m%n/ /layout filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=Device/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ param name=cantMatchReturnValue value=neutral/ /filter filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=PING/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ param name=cantMatchReturnValue value=neutral/ /filter filter class=org.apache.log4j.varia.DenyAllFilter/ /appender What could be the problem? Thanks, Praveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filtering messages with Log4j.xml
That filter is written by me only with the help of this alias :-) iam working for Cisco. Thanks, Praveen On 2/14/06, James Stauffer [EMAIL PROTECTED] wrote: Since you are using a Cisco filter you probably need to check their support for help. On 2/14/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Hi, I am facing a issue with log4j.xml. I have configured filters in xml file as given below: Messages are filtered and logged into specified log file when i run from command prompt. i.e. i wrote a sample java file which will log messages. but when i ran in GUI(web) messages are not getting filtered and logged. appender name=FA class=org.apache.log4j.RollingFileAppender param name=File value=logs/sample.log/ param name=Append value=true/ param name=MaxFileSize value=1KB/ param name=MaxBackupIndex value=2/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{-MM-dd HH:mm:ss} lt;fspgt;%p %m%n/ /layout filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=Device/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ param name=cantMatchReturnValue value=neutral/ /filter filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=PING/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ param name=cantMatchReturnValue value=neutral/ /filter filter class=org.apache.log4j.varia.DenyAllFilter/ /appender What could be the problem? Thanks, Praveen -- James Stauffer 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: Issue with using both the config files (log4j.xml log4j.properties)
Oh it means, I need to transform entire properties to xml file right? Regards, Praveen On 2/8/06, Javier Gonzalez [EMAIL PROTECTED] wrote: On 2/8/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Hi All, Currently we are using *log4j.properties* in our product, we have several log files with respect to modules. We need to use *filters* for one of the *module* (Say module_1) only. So, i have configured *log4j.xml* for this module alone to *filter* the specific messages and remaining modules(say module_2, module_3 and so on..) configured in * log4j.properties*. And i could see some strange behaviour, as *stederr.log* file is filled up with some module (say module_3) log messages. Which shouldn't happen. 1. What could be the wrong? 2. Can we use both the files (.xml and .properties) to configure log? Is it right way to use? As far as I know, (somebody please correct me if I'm wrong), you can't. Your xml file will get read first and that's the configuration that will be used for the whole system. The .properties file will be ignored. And one more thing is When i ran the application, the following exception is thrown and it is logged in *stderr.log* file: 33108 [main] ERROR digester.Digester - Parse Error at line 102 column 11: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*). org.xml.sax.SAXParseException: The content of element type web-app must match looks like a syntax error in a xml file, perhaps web.xml? -- Javier Gonzalez Nicolini
Re: Issue with using both the config files (log4j.xml log4j.properties)
One more basic question, Will all platforms support configuring log4j.xml? Like windows, solaris and Linux? Thanks, Praveen On 2/8/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Thanks Javier. -- Praveen On 2/8/06, Javier Gonzalez [EMAIL PROTECTED] wrote: Exactly. cheers, -- Javier González Nicolini On 2/8/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Oh it means, I need to transform entire properties to xml file right? Regards, Praveen On 2/8/06, Javier Gonzalez [EMAIL PROTECTED] wrote: On 2/8/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Hi All, Currently we are using *log4j.properties* in our product, we have several log files with respect to modules. We need to use *filters* for one of the *module* (Say module_1) only. So, i have configured *log4j.xml* for this module alone to *filter* the specific messages and remaining modules(say module_2, module_3 and so on..) configured in * log4j.properties*. And i could see some strange behaviour, as *stederr.log* file is filled up with some module (say module_3) log messages. Which shouldn't happen. 1. What could be the wrong? 2. Can we use both the files (.xml and .properties) to configure log? Is it right way to use? As far as I know, (somebody please correct me if I'm wrong), you can't. Your xml file will get read first and that's the configuration that will be used for the whole system. The .properties file will be ignored. And one more thing is When i ran the application, the following exception is thrown and it is logged in * stderr.log*file: 33108 [main] ERROR digester.Digester - Parse Error at line 102 column 11: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*). org.xml.sax.SAXParseException: The content of element type web-app must match looks like a syntax error in a xml file, perhaps web.xml? -- Javier Gonzalez Nicolini
Re: Issue with using both the config files (log4j.xml log4j.properties)
Thanks again Javier.. --Praveen On 2/8/06, Javier Gonzalez [EMAIL PROTECTED] wrote: I've used it in both windows and linux with equal success :) I don't have a solaris machine handy, but I'd guess it works, too. On 2/8/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: One more basic question, Will all platforms support configuring log4j.xml? Like windows, solaris and Linux? Thanks, Praveen On 2/8/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Thanks Javier. -- Praveen On 2/8/06, Javier Gonzalez [EMAIL PROTECTED] wrote: Exactly. cheers, -- Javier González Nicolini On 2/8/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Oh it means, I need to transform entire properties to xml file right? Regards, Praveen On 2/8/06, Javier Gonzalez [EMAIL PROTECTED] wrote: On 2/8/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Hi All, Currently we are using *log4j.properties* in our product, we have several log files with respect to modules. We need to use *filters* for one of the *module* (Say module_1) only. So, i have configured *log4j.xml* for this module alone to *filter* the specific messages and remaining modules(say module_2, module_3 and so on..) configured in * log4j.properties*. And i could see some strange behaviour, as *stederr.log* file is filled up with some module (say module_3) log messages. Which shouldn't happen. 1. What could be the wrong? 2. Can we use both the files (.xml and .properties) to configure log? Is it right way to use? As far as I know, (somebody please correct me if I'm wrong), you can't. Your xml file will get read first and that's the configuration that will be used for the whole system. The .properties file will be ignored. And one more thing is When i ran the application, the following exception is thrown and it is logged in * stderr.log*file: 33108 [main] ERROR digester.Digester - Parse Error at line 102 column 11: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*). org.xml.sax.SAXParseException: The content of element type web-app must match looks like a syntax error in a xml file, perhaps web.xml? -- Javier Gonzalez Nicolini -- Javier González Nicolini
Backup files are not getting created
Hi All, Backup files are not getting created. After reaching the 10mb its rolling the same file. Is anything wrong with the configuration? appender name=P class=org.apache.log4j.RollingFileAppender param name=Threshold value=ERROR/ param name=File value=sample.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=maxBackupIndex value=10/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{-MM-dd HH:mm:ss} lt;fspgt;%p %m%n/ /layout filter class=org.apache.log4j.varia.DenyAllFilter/ /appender Thanks, Praveen
How to apply multiple filters to single appender
How can we apply multiple filters (more than one filter) to single appender? I have a custome filter(StringMatchFilter), which will filter based on given string. I have configured as given below. but filter is happening on only first filter, second filter is ignored. But, If i use different appenders it is working. appender name=A1 class=org.apache.log4j.RollingFileAppender param name=File value=file1.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{-MM-dd HH:mm:ss} [%p] %m%n/ /layout !-- To filter with string SNMP -- filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=SNMP/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ /filter !-- To filter with string PING -- filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=PING/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ /filter /appender Thanks In Advance, Praveen
Re: Logging junk data while filtering using log4j.xml
We have various modules in my appln, in which one of the module needs filtering of messages. So, we need to mention the package name (com.mapack) to filter for that particular package only right? If not, how can we specify or differentiate from other appenders in config file. Let me know if i am wrong. Thanks, Praveen On 1/8/06, James Stauffer [EMAIL PROTECTED] wrote: I don't know why you would get extra space characters. Given what you show, there is no reason to have the com.mypack logger in the config file. On 1/7/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Thanks James, it is working now. But some times i could see empty space (characters) getting appended in respective log files. I have modified some thing like this: logger name=com.mypack additivity=false level value=debug/ appender-ref ref=P/ appender-ref ref=PA/ /logger root priority value =debug/ appender-ref ref=P/ appender-ref ref=PA/ /root What could be the reason? Regards, Praveen On 1/5/06, James Stauffer [EMAIL PROTECTED] wrote: Change your config to include the logger/category in the output. When you find the logger of the bad messages, change your config to not log them (or only log warn and above). On 1/5/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Hi All, I have a Filter class (StringMatchFilter.java) which will filter for specific message. By default i will log all the messages to one log file (file1.log) and if particular string matches (based on defined filter) it should logto file1.log and another log file (file1.log) too. I have configured in log4j.xml for it as shown below. Filtering is working , but whenever i restart tomcat some junk data related to Tomcat server is also getting logged into this file and some times empty spaces are getting occupied in the file1.log and file2.log. Sample junk data: [2006-01-05 20:54:56] [DEBUG] ignorableWhitespace( ) [2006-01-05 20:54:56] [DEBUG] startElement(,,rtexprvalue) [2006-01-05 20:54:56] [DEBUG] Pushing body text '' [2006-01-05 20:54:56] [DEBUG] New match='taglib/tag/attribute/rtexprvalue' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute/rtexprvalue'. [2006-01-05 20:54:56] [DEBUG] characters(true) [2006-01-05 20:54:56] [DEBUG] endElement(,,rtexprvalue) [2006-01-05 20:54:56] [DEBUG] match='taglib/tag/attribute/rtexprvalue' [2006-01-05 20:54:56] [DEBUG] bodyText='true' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute/rtexprvalue'. [2006-01-05 20:54:56] [DEBUG] Popping body text '' [2006-01-05 20:54:56] [DEBUG] ignorableWhitespace( ) [2006-01-05 20:54:56] [DEBUG] endElement(,,attribute) [2006-01-05 20:54:56] [DEBUG] match='taglib/tag/attribute' [2006-01-05 20:54:56] [DEBUG] bodyText='' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute' Because of it file size is grwoing like anything. Even not backing up files. What could be the problem? is it in configuration or in filter class file? Could anyone suggest me? Here iam listing sample xml file and java file: log4j.xml ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; !-- MyPackage Rolling Log -- appender name=P class=org.apache.log4j.RollingFileAppender param name=Threshold value=DEBUG/ param name=File value=file1.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=maxBackupIndex value=2/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=[%d{-MM-dd HH:mm:ss}] [%p] %m%n/ /layout /appender !-- MyPackage Rolling Log -- appender name=PA class=org.apache.log4j.RollingFileAppender param name=File value=file2.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=maxBackupIndex value=10/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=[%d{-MM-dd HH:mm:ss}] [%p] %m%n/ /layout filter class= com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=SNMP/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ /filter /appender !-- MyPackage Logger (three packages) -- logger name=com.mypack1 additivity=false appender-ref ref=P/ appender-ref ref
Re: Priority among log4j.properties and log4j.xml
Thanks James for the clarification. So, we need to convert entire log4j.properties to log4j.xml now, since we are using filters. Regards, Praveen On 1/6/06, James Stauffer [EMAIL PROTECTED] wrote: log4j looks for log4j.xml first and if it doesn't find that then it looks for log4j.properties. On 1/6/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Hi All, A basic doubt, we have configured log4j.properties and log4j.xml. Server is Tomcat log4j.properties for basic logging and log4j.xml is for filtering. In this case, which configuration file will be considered? Both? or only log4j.xml file? I observed that, it is ignoring log4j.properties. Can any one suggest me on this. Thanks In Advance, Praveen -- James Stauffer 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: Logging junk data while filtering using log4j.xml
Thanks James, it is working now. But some times i could see empty space (characters) getting appended in respective log files. I have modified some thing like this: logger name=com.mypack additivity=false level value=debug/ appender-ref ref=P/ appender-ref ref=PA/ /logger root priority value =debug/ appender-ref ref=P/ appender-ref ref=PA/ /root What could be the reason? Regards, Praveen On 1/5/06, James Stauffer [EMAIL PROTECTED] wrote: Change your config to include the logger/category in the output. When you find the logger of the bad messages, change your config to not log them (or only log warn and above). On 1/5/06, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Hi All, I have a Filter class (StringMatchFilter.java) which will filter for specific message. By default i will log all the messages to one log file (file1.log) and if particular string matches (based on defined filter) it should logto file1.log and another log file (file1.log) too. I have configured in log4j.xml for it as shown below. Filtering is working , but whenever i restart tomcat some junk data related to Tomcat server is also getting logged into this file and some times empty spaces are getting occupied in the file1.log and file2.log. Sample junk data: [2006-01-05 20:54:56] [DEBUG] ignorableWhitespace( ) [2006-01-05 20:54:56] [DEBUG] startElement(,,rtexprvalue) [2006-01-05 20:54:56] [DEBUG] Pushing body text '' [2006-01-05 20:54:56] [DEBUG] New match='taglib/tag/attribute/rtexprvalue' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute/rtexprvalue'. [2006-01-05 20:54:56] [DEBUG] characters(true) [2006-01-05 20:54:56] [DEBUG] endElement(,,rtexprvalue) [2006-01-05 20:54:56] [DEBUG] match='taglib/tag/attribute/rtexprvalue' [2006-01-05 20:54:56] [DEBUG] bodyText='true' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute/rtexprvalue'. [2006-01-05 20:54:56] [DEBUG] Popping body text '' [2006-01-05 20:54:56] [DEBUG] ignorableWhitespace( ) [2006-01-05 20:54:56] [DEBUG] endElement(,,attribute) [2006-01-05 20:54:56] [DEBUG] match='taglib/tag/attribute' [2006-01-05 20:54:56] [DEBUG] bodyText='' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute' Because of it file size is grwoing like anything. Even not backing up files. What could be the problem? is it in configuration or in filter class file? Could anyone suggest me? Here iam listing sample xml file and java file: log4j.xml ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; !-- MyPackage Rolling Log -- appender name=P class=org.apache.log4j.RollingFileAppender param name=Threshold value=DEBUG/ param name=File value=file1.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=maxBackupIndex value=2/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=[%d{-MM-dd HH:mm:ss}] [%p] %m%n/ /layout /appender !-- MyPackage Rolling Log -- appender name=PA class=org.apache.log4j.RollingFileAppender param name=File value=file2.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=maxBackupIndex value=10/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=[%d{-MM-dd HH:mm:ss}] [%p] %m%n/ /layout filter class= com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=SNMP/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ /filter /appender !-- MyPackage Logger (three packages) -- logger name=com.mypack1 additivity=false appender-ref ref=P/ appender-ref ref=PA/ /logger logger name=com.mypack2 additivity=false appender-ref ref=P/ appender-ref ref=PA/ /logger logger name=com.mypack3 additivity=false appender-ref ref=P/ appender-ref ref=PA/ /logger !-- Set root logger level to DEBUG and its only appender to P, PA -- root priority value =debug/ appender-ref ref=P/ appender-ref ref=PA/ /root /log4j:configuration StringMatchFilter.java -- package com.mypackage.logger.filters; import org.apache.log4j.spi.Filter; import org.apache.log4j.spi.LoggingEvent; public class StringMatchFilter extends Filter { boolean acceptOnMatch = true; String stringToMatch; public int matchReturnValue = Filter.ACCEPT
Priority among log4j.properties and log4j.xml
Hi All, A basic doubt, we have configured log4j.properties and log4j.xml. Server is Tomcat log4j.properties for basic logging and log4j.xml is for filtering. In this case, which configuration file will be considered? Both? or only log4j.xml file? I observed that, it is ignoring log4j.properties. Can any one suggest me on this. Thanks In Advance, Praveen
Logging junk data while filtering using log4j.xml
Hi All, I have a Filter class (StringMatchFilter.java) which will filter for specific message. By default i will log all the messages to one log file (file1.log) and if particular string matches (based on defined filter) it should logto file1.log and another log file (file1.log) too. I have configured in log4j.xml for it as shown below. Filtering is working , but whenever i restart tomcat some junk data related to Tomcat server is also getting logged into this file and some times empty spaces are getting occupied in the file1.log and file2.log. Sample junk data: [2006-01-05 20:54:56] [DEBUG] ignorableWhitespace( ) [2006-01-05 20:54:56] [DEBUG] startElement(,,rtexprvalue) [2006-01-05 20:54:56] [DEBUG] Pushing body text '' [2006-01-05 20:54:56] [DEBUG] New match='taglib/tag/attribute/rtexprvalue' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute/rtexprvalue'. [2006-01-05 20:54:56] [DEBUG] characters(true) [2006-01-05 20:54:56] [DEBUG] endElement(,,rtexprvalue) [2006-01-05 20:54:56] [DEBUG] match='taglib/tag/attribute/rtexprvalue' [2006-01-05 20:54:56] [DEBUG] bodyText='true' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute/rtexprvalue'. [2006-01-05 20:54:56] [DEBUG] Popping body text '' [2006-01-05 20:54:56] [DEBUG] ignorableWhitespace( ) [2006-01-05 20:54:56] [DEBUG] endElement(,,attribute) [2006-01-05 20:54:56] [DEBUG] match='taglib/tag/attribute' [2006-01-05 20:54:56] [DEBUG] bodyText='' [2006-01-05 20:54:56] [DEBUG] No rules found matching 'taglib/tag/attribute' Because of it file size is grwoing like anything. Even not backing up files. What could be the problem? is it in configuration or in filter class file? Could anyone suggest me? Here iam listing sample xml file and java file: log4j.xml ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; !-- MyPackage Rolling Log -- appender name=P class=org.apache.log4j.RollingFileAppender param name=Threshold value=DEBUG/ param name=File value=file1.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=maxBackupIndex value=2/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=[%d{-MM-dd HH:mm:ss}] [%p] %m%n/ /layout /appender !-- MyPackage Rolling Log -- appender name=PA class=org.apache.log4j.RollingFileAppender param name=File value=file2.log/ param name=Append value=true/ param name=MaxFileSize value=10MB/ param name=maxBackupIndex value=10/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=[%d{-MM-dd HH:mm:ss}] [%p] %m%n/ /layout filter class=com.cisco.nettools.logger.filters.StringMatchFilter param name=stringToMatch value=SNMP/ param name=matchReturnValue value=accept/ param name=noMatchReturnValue value=deny/ /filter /appender !-- MyPackage Logger (three packages) -- logger name=com.mypack1 additivity=false appender-ref ref=P/ appender-ref ref=PA/ /logger logger name=com.mypack2 additivity=false appender-ref ref=P/ appender-ref ref=PA/ /logger logger name=com.mypack3 additivity=false appender-ref ref=P/ appender-ref ref=PA/ /logger !-- Set root logger level to DEBUG and its only appender to P, PA -- root priority value =debug/ appender-ref ref=P/ appender-ref ref=PA/ /root /log4j:configuration StringMatchFilter.java -- package com.mypackage.logger.filters; import org.apache.log4j.spi.Filter; import org.apache.log4j.spi.LoggingEvent; public class StringMatchFilter extends Filter { boolean acceptOnMatch = true; String stringToMatch; public int matchReturnValue = Filter.ACCEPT; public int noMatchReturnValue = Filter.DENY; public int cantMatchReturnValue = Filter.NEUTRAL; protected int calcFilterReturnValue(String value) { if (accept.equalsIgnoreCase(value)) return Filter.ACCEPT; else if (deny.equalsIgnoreCase(value)) return Filter.DENY; else return Filter.NEUTRAL; } public void setMatchReturnValue(String value) { matchReturnValue = calcFilterReturnValue(value); } public void setNoMatchReturnValue(String value) { noMatchReturnValue = calcFilterReturnValue(value); } public void setCantReturnValue(String value) { cantMatchReturnValue = calcFilterReturnValue(value); } public void setStringToMatch(String s) { stringToMatch = s; }
Re: Logging custom levels using log4j
Thank you very mcuh Scott. So we need to use log4j1.2 only and need to write a filter class which does logging based on specified message, and configure in log4j.xml. Regards, Praveen On 1/2/06, Scott Deboy [EMAIL PROTECTED] wrote: Filters are supported in 1.2 - ExpressionFilter is new with 1.3. I wouldn't use 1.3 in production - it's still at an alpha release. I believe you can't configure filters via a properties file - you need to use an xml configuration file. If you have an xml file and a properties file, only the xml configuration will be used. Scott -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Mon 1/2/2006 7:48 AM To: Log4J Users List Subject: Re: Logging custom levels using log4j Thanks Scott, Currenlty we are using log4j1.2 , but to support filters we need to use log4j1.3 right? Will it be major changes needed to change it to higher version? And currently we are using log4j.properties for all types of logging. In addition to that, to configure filters, we need to use log4j.xml for configuring. Can we have both the type of configurations? (i.e log4j.xml for filters and log4j.properties for others) Which one will take precedence? Regards, Praveen On 12/30/05, Scott Deboy [EMAIL PROTECTED] wrote: I don't think you can specify filters in the properties file format - use an xml config file instead. Here's an example: appender name=someAppender class=org.apache.log4j.FileAppender layout class=org.apache.log4j.SimpleLayout/ filter class=org.apache.log4j.varia.ExpressionFilter param name=Expression value=msg ~= blah / param name=AcceptOnMatch value=true/ param name=ConvertInFixToPostFix value=true/ /filter filter class=org.apache.log4j.varia.DenyAllFilter/ /appender The denyallfilter makes sure the events are dropped if they weren't accepted by the expression filter. Scott -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Fri 12/30/2005 6:46 AM To: Log4J Users List Subject: Re: Logging custom levels using log4j Hi , We are using Struts framework for our product(application) and using logj.properties file to configure logging. How can i configure Expression-based filters in log4j.properties? Is it possible to configure in properties file? One more basic question, Can we use both log4j.properties and log4j.xmlfile to configure for an application? Could anyone clarify me. Thanks -Praveen On 12/29/05, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Thanks Scott, I think this will help me. Regards, Praveen On 12/29/05, Scott Deboy [EMAIL PROTECTED] wrote: You can do this using log4j 1.3 using ExpressionFilter, or you could write your own filter that does the same thing. Route all the events to both file appenders, and specify a different ExpressionFilter on each appender. An example expression you would use with ExpressionFilter: MSG ~= SNMP Remember to put spaces around the operators, etc. You can find out more information on the expression syntax by viewing Chainsaw V2's tutorial: http://logging.apache.org/log4j/docs/chainsaw.html Scott -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Thu 12/29/2005 9:17 AM To: log4j-user@logging.apache.org Subject: Logging custom levels using log4j Hi All, I need to log specified particular type of messages to one log file and rest to another log file. For example say, if message contains SNMP or CDP and so on, need to log in to log1.log and rest of the messages need to log in to log2.log How to configure the log4j.properties to log custom levels? Is there any provision to create custom levels and to configure it? I heard that we can do this with the use of Filters. Could anyone suggest me better solution for this. Thanks in Advance, Praveen - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logging custom levels using log4j
Thanks Scott, Currenlty we are using log4j1.2 , but to support filters we need to use log4j1.3 right? Will it be major changes needed to change it to higher version? And currently we are using log4j.properties for all types of logging. In addition to that, to configure filters, we need to use log4j.xml for configuring. Can we have both the type of configurations? (i.e log4j.xml for filters and log4j.properties for others) Which one will take precedence? Regards, Praveen On 12/30/05, Scott Deboy [EMAIL PROTECTED] wrote: I don't think you can specify filters in the properties file format - use an xml config file instead. Here's an example: appender name=someAppender class=org.apache.log4j.FileAppender layout class=org.apache.log4j.SimpleLayout/ filter class=org.apache.log4j.varia.ExpressionFilter param name=Expression value=msg ~= blah / param name=AcceptOnMatch value=true/ param name=ConvertInFixToPostFix value=true/ /filter filter class=org.apache.log4j.varia.DenyAllFilter/ /appender The denyallfilter makes sure the events are dropped if they weren't accepted by the expression filter. Scott -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Fri 12/30/2005 6:46 AM To: Log4J Users List Subject: Re: Logging custom levels using log4j Hi , We are using Struts framework for our product(application) and using logj.properties file to configure logging. How can i configure Expression-based filters in log4j.properties? Is it possible to configure in properties file? One more basic question, Can we use both log4j.properties and log4j.xmlfile to configure for an application? Could anyone clarify me. Thanks -Praveen On 12/29/05, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Thanks Scott, I think this will help me. Regards, Praveen On 12/29/05, Scott Deboy [EMAIL PROTECTED] wrote: You can do this using log4j 1.3 using ExpressionFilter, or you could write your own filter that does the same thing. Route all the events to both file appenders, and specify a different ExpressionFilter on each appender. An example expression you would use with ExpressionFilter: MSG ~= SNMP Remember to put spaces around the operators, etc. You can find out more information on the expression syntax by viewing Chainsaw V2's tutorial: http://logging.apache.org/log4j/docs/chainsaw.html Scott -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Thu 12/29/2005 9:17 AM To: log4j-user@logging.apache.org Subject: Logging custom levels using log4j Hi All, I need to log specified particular type of messages to one log file and rest to another log file. For example say, if message contains SNMP or CDP and so on, need to log in to log1.log and rest of the messages need to log in to log2.log How to configure the log4j.properties to log custom levels? Is there any provision to create custom levels and to configure it? I heard that we can do this with the use of Filters. Could anyone suggest me better solution for this. Thanks in Advance, Praveen - 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: Logging custom levels using log4j
Hi , We are using Struts framework for our product(application) and using logj.properties file to configure logging. How can i configure Expression-based filters in log4j.properties? Is it possible to configure in properties file? One more basic question, Can we use both log4j.properties and log4j.xml file to configure for an application? Could anyone clarify me. Thanks -Praveen On 12/29/05, Praveen Kumar Hasthalapuram [EMAIL PROTECTED] wrote: Thanks Scott, I think this will help me. Regards, Praveen On 12/29/05, Scott Deboy [EMAIL PROTECTED] wrote: You can do this using log4j 1.3 using ExpressionFilter, or you could write your own filter that does the same thing. Route all the events to both file appenders, and specify a different ExpressionFilter on each appender. An example expression you would use with ExpressionFilter: MSG ~= SNMP Remember to put spaces around the operators, etc. You can find out more information on the expression syntax by viewing Chainsaw V2's tutorial: http://logging.apache.org/log4j/docs/chainsaw.html Scott -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Thu 12/29/2005 9:17 AM To: log4j-user@logging.apache.org Subject: Logging custom levels using log4j Hi All, I need to log specified particular type of messages to one log file and rest to another log file. For example say, if message contains SNMP or CDP and so on, need to log in to log1.log and rest of the messages need to log in to log2.log How to configure the log4j.properties to log custom levels? Is there any provision to create custom levels and to configure it? I heard that we can do this with the use of Filters. Could anyone suggest me better solution for this. Thanks in Advance, Praveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Logging custom level using log4j in java
Hi All, I need to log specified particular type of messages to one log file and rest to another log file. For example say, if message contains SNMP or CDP and so on, need to log in to log1.log and rest of the messages need to log in to log2.log How to configure the log4j.properties to log custom levels? Is there any provision to create custom levels and to configure it? I heard that by Filters we can do this, It will be great if anyone throw some light on this. Thanks In Advacne, Praveen
Logging custom levels using log4j
Hi All, I need to log specified particular type of messages to one log file and rest to another log file. For example say, if message contains SNMP or CDP and so on, need to log in to log1.log and rest of the messages need to log in to log2.log How to configure the log4j.properties to log custom levels? Is there any provision to create custom levels and to configure it? I heard that we can do this with the use of Filters. Could anyone suggest me better solution for this. Thanks in Advance, Praveen
Re: Logging custom level using log4j in java
Thanks Philip, I will go with first solution, because with second soultion may lead performance overhead and it is time consuming process. Regards, Praveen On 12/29/05, Philip Denno [EMAIL PROTECTED] wrote: I think you misunderstand the idea of level. Levels in log4j are things like DEBUG, INFO, WARN, ERROR, FATAL. So if your level is set to INFO and in your call you execute logger.debug(message) - then the message will be thrown away, because DEBUG INFO. On the other hand if you execute logger.info(message) - this message will be written to the file, because INFO = INFO. Several solutions come to mind: 1) Create two loggers and make sure every call that contains SNMP go to logger 1 and everything else to logger 2. 2) Write everything to one file and use some log filtering tool to view. Finally, there may be a way to use Filters to re-direct, as I do not have much experience with these, however I think this is just a finer - grained mechanism to control what goes into the log file. Cheers, Philip. -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: December 29, 2005 9:07 AM To: log4j-user@logging.apache.org Subject: Logging custom level using log4j in java Hi All, I need to log specified particular type of messages to one log file and rest to another log file. For example say, if message contains SNMP or CDP and so on, need to log in to log1.log and rest of the messages need to log in to log2.log How to configure the log4j.properties to log custom levels? Is there any provision to create custom levels and to configure it? I heard that by Filters we can do this, It will be great if anyone throw some light on this. Thanks In Advacne, Praveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logging custom levels using log4j
Thanks Scott, I think this will help me. Regards, Praveen On 12/29/05, Scott Deboy [EMAIL PROTECTED] wrote: You can do this using log4j 1.3 using ExpressionFilter, or you could write your own filter that does the same thing. Route all the events to both file appenders, and specify a different ExpressionFilter on each appender. An example expression you would use with ExpressionFilter: MSG ~= SNMP Remember to put spaces around the operators, etc. You can find out more information on the expression syntax by viewing Chainsaw V2's tutorial: http://logging.apache.org/log4j/docs/chainsaw.html Scott -Original Message- From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED] Sent: Thu 12/29/2005 9:17 AM To: log4j-user@logging.apache.org Subject: Logging custom levels using log4j Hi All, I need to log specified particular type of messages to one log file and rest to another log file. For example say, if message contains SNMP or CDP and so on, need to log in to log1.log and rest of the messages need to log in to log2.log How to configure the log4j.properties to log custom levels? Is there any provision to create custom levels and to configure it? I heard that we can do this with the use of Filters. Could anyone suggest me better solution for this. Thanks in Advance, Praveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]