Sorry, I got confused when you said "<=Error" in your original post, was that a typo, did you mean >=Error?
Ok, to confirm, you only want ERROR and FATAL to go to your file appender, and allow all errors to go to the console? cheers, Paul On Mon, 2003-09-08 at 08:12, Matt Raible wrote: > I believe I have it configured correctly. I want to log messages that > are FATAL or ERROR - nothing above error. > > Matt > > -----Original Message----- > From: Paul Smith [mailto:[EMAIL PROTECTED] > Sent: Sunday, September 07, 2003 4:05 PM > To: Log4J Users List > Subject: Re: LevelRangeFilter not working > > > Hi Matt, > > I think you might have 2 filters confused. LevelRangeFilter needs a > range of Levels to accept/deny. In your case you have said that the > Maximum is Error, but have no Minimum set and therefore only logs with > levels greater than error will get denied. > > You are probably wanting the LevelMatchFilter which takes a single level > to match, and only accepts those, denies all others. > > Otherwise you could set the LevelMin of the LevelRangeFilter to ERROR > and that should work too, I think. > > cheers, > > Paul Smith > > On Sat, 2003-09-06 at 07:55, Matt Raible wrote: > > I two appenders - a console and a file. I want all messages to go to > > the console and only <= error to go to the file. > > > > In my file appender, I have a filter to only get the error messages: > > > > <filter class="org.apache.log4j.varia.LevelRangeFilter"> > > <param name="LevelMax" value="ERROR" /> > > </filter> > > > > Then in <root> I have: > > > > <root> > > <level value="DEBUG"/> > > <appender-ref ref="CONSOLE"/> > > <appender-ref ref="FILE"/> > > </root> > > > > From the documentation I've read (i.e. http://tinyurl.com/meef), this > > *should* work. However, all messages get logged to both the console > > appender and the file appender. > > > > Help is appreciated. > > > > Matt > > > > My full log4j.xml file: > > > > <?xml version="1.0" encoding="UTF-8" ?> > > <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> > > > > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> > > > > <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> > > <layout class="org.apache.log4j.PatternLayout"> > > <param name="ConversionPattern" value="%p - %C{1}.%M(%L) | > %m%n"/> > > </layout> > > </appender> > > > > <appender name="ERROR_LOG" > > class="org.apache.log4j.RollingFileAppender"> > > <param name="File" > > value="${catalina.home}[EMAIL PROTECTED]@/error.log"/> > > <param name="Append" value="false"/> > > <param name="MaxFileSize" value="333KB"/> > > <param name="MaxBackupIndex" value="3"/> > > <layout class="org.apache.log4j.PatternLayout"> > > <param name="ConversionPattern" value="%d [%t] %-5p %c{2} - > > %m%n"/> > > </layout> > > <filter class="org.apache.log4j.varia.LevelRangeFilter"> > > <param name="LevelMax" value="ERROR" /> > > </filter> > > </appender> > > > > <logger name="org.apache"> > > <level value="WARN"/> > > <appender-ref ref="CONSOLE"/> > > </logger> > > > > <root> > > <level value="DEBUG"/> > > <appender-ref ref="CONSOLE"/> > > <appender-ref ref="ERROR_LOG"/> > > </root> > > > > </log4j:configuration> > > > > > > > > --------------------------------------------------------------------- > > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]