title: log4j.properties configuration
body: <p>I have 2 classes, LogonPolicyServer and SCE. I need log information from LogonPolicyServer to first file (firstFile.log) , log information from SCE to first file, log errors from SCE to second file (secondFile.log) and print information and errors from SCE class to console, but when i try do this, information from LogonPolicyServer print to console too.
  My log4j.properties:</p>
  
  <pre>
  
      log4j.rootLogger=INFO, console
  
      log4j.appender.console = org.apache.log4j.ConsoleAppender
      log4j.appender.console.target=System.out
      log4j.appender.console.layout = org.apache.log4j.PatternLayout
      log4j.appender.console.layout.ConversionPattern = %d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
  
      log4j.logger.infoNTS=DEBUG, file
      log4j.appender.file=org.apache.log4j.RollingFileAppender
      log4j.appender.file.file=log/spider.cisco.log
      log4j.appender.file.MaxFileSize=1GB
      log4j.appender.file.MaxBackupIndex=10
      log4j.appender.file.layout=org.apache.log4j.PatternLayout
      log4j.appender.file.layout.conversionPattern=%d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
  
      log4j.logger.errorlog=ERROR, errorFile
      log4j.appender.errorFile=org.apache.log4j.RollingFileAppender
      log4j.appender.errorFile.file=log/error.spider.cisco.log
      log4j.appender.errorFile.MaxFileSize=1GB
      log4j.appender.errorFile.MaxBackupIndex=10
      log4j.appender.errorFile.layout=org.apache.log4j.PatternLayout
      log4j.appender.errorFile.layout.conversionPattern=%d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
      log4j.appender.errorFile.Threshold=ERROR
  
  </pre>
  
  <p>In LogonPolicyServer i'll try:</p>
  
  <pre>
  
      private static final Logger log = Logger.getLogger("infoNTS");
  
      //connect logger
  
  </pre>
  
  <p>then print information:</p>
  
  <pre>
  
  
      log.debug("Record "+i+":"+record.name+" "+res.getString(3)+" "+res.getString(4));
  
  </pre>
  
  <p>SCE: </p>
  
  <pre>
  
      private static final Logger log = Logger.getLogger("infoNTS");
      private static final Logger errorLog = Logger.getLogger("errorlog");
  
  </pre>
  
  <p>Then print:</p>
  
  <pre>
  
      try{
       api.synchronizePushStart(resultHandler);
       log.info("Start synchronization for SCE:"+sceIP+" started successfully");
      }catch(Exception e){
       errorLog.error("Start synchronization for SCE:"+sceIP+" failed!", e);
      }
  
  </pre>
  
  <p>What is wrong?
  UPD: Latest log4j.properties</p>
  
  <pre>
  
      log4j.rootLogger=FATAL, console
  
      log4j.appender.console = org.apache.log4j.ConsoleAppender
      log4j.appender.console.target=System.out
      log4j.appender.console.layout = org.apache.log4j.PatternLayout
      log4j.appender.console.layout.ConversionPattern = %d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
  
      log4j.logger.infoNTS=DEBUG, file
      log4j.appender.file=org.apache.log4j.RollingFileAppender
      log4j.appender.file.file=log/spider.cisco.log
      log4j.appender.file.MaxFileSize=1GB
      log4j.appender.file.MaxBackupIndex=10
      log4j.appender.file.layout=org.apache.log4j.PatternLayout
      log4j.appender.file.layout.conversionPattern=%d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
  
      log4j.logger.errorlog=ERROR, errorFile
      log4j.appender.errorFile=org.apache.log4j.RollingFileAppender
      log4j.appender.errorFile.file=log/error.spider.cisco.log
      log4j.appender.errorFile.MaxFileSize=1GB
      log4j.appender.errorFile.MaxBackupIndex=10
      log4j.appender.errorFile.layout=org.apache.log4j.PatternLayout
      log4j.appender.errorFile.layout.conversionPattern=%d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
      log4j.appender.errorFile.Threshold=ERROR
  
  
  </pre>
  
  <p>UPD2:
  This helped:</p>
  
  <pre>
  
  
      log4j.rootLogger=OFF, fatalFile
      log4j.appender.fatalFile=org.apache.log4j.RollingFileAppender
      log4j.appender.fatalFile.file=log/fatal.log
      log4j.appender.fatalFile.MaxFileSize=10MB
      log4j.appender.fatalFile.MaxBackupIndex=10
      log4j.appender.fatalFile.layout=org.apache.log4j.PatternLayout
      log4j.appender.fatalFile.layout.conversionPattern=%d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
  
      log4j.logger.infoNTScopy=DEBUG, file
      log4j.logger.infoNTS=DEBUG, file, console
      log4j.appender.file=org.apache.log4j.RollingFileAppender
      log4j.appender.file.file=log/spider.cisco.log
      log4j.appender.file.MaxFileSize=1GB
      log4j.appender.file.MaxBackupIndex=10
      log4j.appender.file.layout=org.apache.log4j.PatternLayout
      log4j.appender.file.layout.conversionPattern=%d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
  
  
      log4j.logger.errorlog=ERROR, errorFile, console
      log4j.appender.errorFile=org.apache.log4j.RollingFileAppender
      log4j.appender.errorFile.file=log/error.spider.cisco.log
      log4j.appender.errorFile.MaxFileSize=1GB
      log4j.appender.errorFile.MaxBackupIndex=10
      log4j.appender.errorFile.layout=org.apache.log4j.PatternLayout
      log4j.appender.errorFile.layout.conversionPattern=%d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
      log4j.appender.errorFile.Threshold=ERROR
  
  
      log4j.appender.console = org.apache.log4j.ConsoleAppender
      log4j.appender.console.target=System.out
      log4j.appender.console.layout = org.apache.log4j.PatternLayout
      log4j.appender.console.layout.ConversionPattern = %d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n
  
  </pre>
  
  <p>In LogonPolicyServer:</p>
  
  <pre>
  
      private static final Logger log = Logger.getLogger("infoNTScopy");
  
  </pre>
  
  <p>But now i need disable/remove root logger.</p>