We help IT Professionals succeed at work.
Get Started

Log4j: how to  Disable info and debug levels logs through configuration file

isaihat asked
Last Modified: 2012-06-27
Hi guys,

i have this XML config file:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

    <appender name="console" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{dd-MM-yy HH:mm:ss.SSS}-%p-%C-%t- %m%n"/>

    <appender name="AccountActivation" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File" value="log/AdapterService.log"/>
        <layout class="org.apache.log4j.PatternLayout">

         <!--   <param name="ConversionPattern" value="%d{dd-MM-yy HH:mm:ss.SSS}[%p][%t][%c{1}]- %m%n"/> -->
      <param name="ConversionPattern" value="%d %-5r %-5p [%C{1}] {%t} %m%n"/>

    <category name="org.exolab.castor.jdo">
      <priority value="warn" />

    <category name="org.exolab.castor.persist">
      <priority value="warn" />

        <priority value="debug" />      
        <appender-ref ref="AccountActivation"/>


using this file, how can i disable the INFO and DEBUG to appear in logs,

and not allow any of them to be viewed

where i do not want to change the orginal code

best regads,
Watch Question
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE