You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Praveen Kumar Hasthalapuram <pr...@gmail.com> on 2006/02/14 14:38:06 UTC

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="10000KB"/>
        <param name="MaxBackupIndex" value="2"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss}
&lt;fsp&gt;%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

Posted by Praveen Kumar Hasthalapuram <pr...@gmail.com>.
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 <st...@gmail.com> wrote:
>
> Since you are using a Cisco filter you probably need to check their
> support for help.
>
> On 2/14/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> 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="10000KB"/>
> >         <param name="MaxBackupIndex" value="2"/>
> >         <layout class="org.apache.log4j.PatternLayout">
> >             <param name="ConversionPattern" value="%d{yyyy-MM-dd
> HH:mm:ss}
> > &lt;fsp&gt;%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: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: Filtering messages with Log4j.xml

Posted by James Stauffer <st...@gmail.com>.
Since you are using a Cisco filter you probably need to check their
support for help.

On 2/14/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> 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="10000KB"/>
>         <param name="MaxBackupIndex" value="2"/>
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss}
> &lt;fsp&gt;%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: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org