log4j.xml 7.96 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

  <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="-%p %d (%c{1}) %m%n"/>
    </layout>
  </appender>

<!--  <appender name="HARVESTER_LOG" class="org.apache.log4j.rolling.RollingFileAppender">-->
  <appender name="HARVESTER_LOG" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="/var/log/metarepository/harvester.log"/>
	<param name="Append" value="true" />
<!--    <param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="100"/> -->
   <rollingPolicy name="File" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/var/log/metarepository/harvester.log.%d{yyyy-MM-dd}.gz"/>
        <param name="ActiveFileName" value="/var/log/metarepository/harvester.log"/>
     </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%p %d (%c{1}) %m%n"/>
    </layout>
    <filter class="org.apache.log4j.varia.LevelRangeFilter">
      <param name="LevelMin" value="DEBUG"/>
      <param name="LevelMax" value="INFO"/>
    </filter>
  </appender>

  <appender name="SEARCH_LOG" class="org.apache.log4j.RollingFileAppender">
<!--  <appender name="SEARCH_LOG" class="org.apache.log4j.rolling.RollingFileAppender"> -->
    	<param name="File" value="/var/log/metarepository/search.log"/>
	<param name="Append" value="true" />
<!--    <param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="100"/> -->
 <rollingPolicy name="File" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/var/log/metarepository/search.log.%d{yyyy-MM-dd}.gz"/>
        <param name="ActiveFileName" value="/var/log/metarepository/search.log"/>
     </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%p %d (%c{1}) %m%n"/>
    </layout>
  </appender>

  <appender name="SQL_LOG" class="org.apache.log4j.RollingFileAppender"> 
<!--  <appender name="SQL_LOG" class="org.apache.log4j.rolling.RollingFileAppender"> -->
    <param name="File" value="/var/log/metarepository/sql.log"/>
	<param name="Append" value="true" />
    <!--<param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="100"/>-->
	 <rollingPolicy name="File" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/var/log/metarepository/sql.log.%d{yyyy-MM-dd}.gz"/>
        <param name="ActiveFileName" value="/var/log/metarepository/sql.log"/>
     </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%p %d (%c{1}) %m%n"/>
    </layout>
  </appender>

   <appender name="METAREPOSITORY_LOG" class="org.apache.log4j.RollingFileAppender"> 
  <!-- <appender name="METAREPOSITORY_LOG" class="org.apache.log4j.rolling.RollingFileAppender"> -->
	<param name="File" value="/var/log/metarepository/metarepository.log"/>
    	<param name="Append" value="true" />
    <!-- <param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="100"/> -->
     <rollingPolicy name="File" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/var/log/metarepository/metarepository.log.%d{yyyy-MM-dd}.gz"/>
        <param name="ActiveFileName" value="/var/log/metarepository/metarepository.log"/>
     </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="#%p %d (%c{1}) %m%n"/>
    </layout>
    <filter class="org.apache.log4j.varia.LevelRangeFilter">
      <param name="LevelMin" value="INFO"/>
    </filter>
  </appender> 


  <appender name="VALIDATOR_LOG" class="org.apache.log4j.RollingFileAppender"> 
<!--  <appender name="VALIDATOR_LOG" class="org.apache.log4j.rolling.RollingFileAppender"> -->
    <param name="File" value="/var/log/metarepository/validator.log"/>
	<param name="Append" value="true" />
<!--    <param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="100"/> -->
    <rollingPolicy name="File" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/var/log/metarepository/validator.log.%d{yyyy-MM-dd}.gz"/>
        <param name="ActiveFileName" value="/var/log/metarepository/validator.log"/>
     </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="!%p %d (%c{1}) %m%n"/>
    </layout>
    <filter class="org.apache.log4j.varia.LevelRangeFilter">
      <param name="LevelMin" value="DEBUG"/>
    </filter>
  </appender>

  <appender name="ERROR_LOG" class="org.apache.log4j.RollingFileAppender"> 
<!--  <appender name="ERROR_LOG" class="org.apache.log4j.rolling.RollingFileAppender"> -->
    <param name="File" value="/var/log/metarepository/errors.log"/>
	<param name="Append" value="true" />
    <!-- <param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="100"/> -->
<rollingPolicy name="File" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/var/log/metarepository/errors.log.%d{yyyy-MM-dd}.gz"/>
        <param name="ActiveFileName" value="/var/log/metarepository/errors.log"/>
     </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value=";%p %d (%c{1}) %m%n"/>
    </layout>
    <filter class="org.apache.log4j.varia.LevelRangeFilter">
      <param name="LevelMin" value="ERROR"/>
    </filter>
  </appender>

  <appender name="SOLR_LOG" class="org.apache.log4j.RollingFileAppender">
 <!--  <appender name="SOLR_LOG" class="org.apache.log4j.rolling.RollingFileAppender">  -->
    <param name="File" value="/var/log/metarepository/solr.log"/>
	<param name="Append" value="true" />
    <!-- <param name="MaxFileSize" value="10MB"/>
    <param name="MaxBackupIndex" value="100"/> -->
<rollingPolicy name="File" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/var/log/metarepository/solr.log.%d{yyyy-MM-dd}.gz"/>
        <param name="ActiveFileName" value="/var/log/metarepository/solr.log"/>
     </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value=":%p %d (%c{1}) %m%n"/>
    </layout>
    <!--<filter class="org.apache.log4j.varia.LevelRangeFilter">
      <param name="LevelMin" value="ERROR"/>
    </filter>-->
  </appender>


  <logger name="org.apache.solr.core.SolrCore" additivity="false">
    <level value="INFO"/>
    <appender-ref ref="SOLR_LOG"/>
  </logger>

  <logger name="org.apache.solr" additivity="false">
    <appender-ref ref="SOLR_LOG"/>
  </logger>

  <logger name="pt.keep.metarepository.core.app" additivity="false">
    <level value="INFO"/>
    <appender-ref ref="HARVESTER_LOG"/>
    <appender-ref ref="ERROR_LOG"/>
    <appender-ref ref="STDOUT"/>
  </logger>

  <logger name="pt.keep.metarepository.core.harvester" additivity="false">
    <level value="DEBUG"/>
    <appender-ref ref="VALIDATOR_LOG"/>
    <appender-ref ref="HARVESTER_LOG"/>
    <appender-ref ref="ERROR_LOG"/>
  </logger>

  <logger name="pt.keep.metarepository.core.validator" additivity="false">
    <level value="DEBUG"/>
    <appender-ref ref="VALIDATOR_LOG"/>
  </logger>

  <logger name="pt.keep.metarepository" additivity="false">
    <level value="DEBUG"/>
    <appender-ref ref="ERROR_LOG"/>
    <appender-ref ref="METAREPOSITORY_LOG"/>
  </logger>

  <logger name="searchLog" additivity="false">
    <level value="INFO"/>
    <appender-ref ref="SEARCH_LOG"/>
  </logger>

  <logger name="sqlLog" additivity="false">
    <level value="INFO"/>
    <appender-ref ref="SQL_LOG"/>
  </logger>


  <root>
    <level value="WARN"/>
    <appender-ref ref="STDOUT"/>
  </root>
</log4j:configuration>