Hi,
I have downloaded the log4j extras companion from http://people.apache.org/builds/logging/log4j/companions/extras/1.0/ <http://people.apache.org/builds/logging/log4j/companions/extras/1.0/> and I am trying to use an Expression Filter with log4j 1.2.13. I have added the apache-log4j-extras-1.0.jar to my classpath. But, for the life of me I cannot get it to work. Here is my appender config where I'm trying to use the Expression Filter. <appender name="SMTPAppender" class="org.apache.log4j.net.SMTPAppender"> <param name="SMTPHost" value="blah"/> <param name="From" value="[EMAIL PROTECTED] "/> <param name="To" value="[EMAIL PROTECTED] "/> <param name="Subject" value="my subject"/> <param name="BufferSize" value="50" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %c{1}:%L - %m%n"/> </layout> <filter class="org.apache.log4j.filter.ExpressionFilter"> <param name="Expression" value="msg ~= blah" /> <param name="AcceptOnMatch" value="true"/> <param name="ConvertInFixToPostFix" value="true"/> </filter> <filter class="org.apache.log4j.filter.DenyAllFilter"/> </appender> It just seems to halt on load and doesn't give me any error message. Here is the log4j debug output. You will see it just halts after parsing the convertInFixToPostFix property. log4j: Class name: [org.apache.log4j.net.SMTPAppender] log4j: Setting property [SMTPHost] to [blah]. log4j: Setting property [from] to [EMAIL PROTECTED] ]. log4j: Setting property [to] to [EMAIL PROTECTED] ]. log4j: Setting property [subject] to [my subject]. log4j: Setting property [bufferSize] to [50]. log4j: Parsing layout of class: "org.apache.log4j.PatternLayout" log4j: Setting property [conversionPattern] to [%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %c{1}:%L - %m%n]. log4j: Setting property [expression] to [msg ~= blah]. log4j: Setting property [acceptOnMatch] to [true]. log4j: Setting property [convertInFixToPostFix] to [true]. I have found this thread via Google, but it is from 2005 and there is no "varia" in the package name with the extras companion: http://mail-archives.apache.org/mod_mbox/logging-log4j-user/200601.mbox/%3C8 [EMAIL PROTECTED] <http://mail-archives.apache.org/mod_mbox/logging-log4j-user/200601.mbox/%3C [EMAIL PROTECTED]> Can anyone help? Thanks, Simon. Simon Wallis Developer RBS Global Banking & Markets London - 42 Islington High St, (Regents House) - N1 8XL *********************************************************************************** The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Authorised and regulated by the Financial Services Authority This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. Visit our websites at: www.rbs.com www.rbs.com/gbm www.rbsgc.com *********************************************************************************** ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
