kettle5.2添加日志

  • Post author:
  • Post category:其他


创建log4j.xml文件,放置与spoon.sh同目录下。内容如下:

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
 <appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
  <layout class="org.apache.log4j.PatternLayout">
   <param name="ConversionPattern" value="%d{MM-dd HH:mm:ss.SSS}  %5p [%t] (%F:%L) -%m%n" />
  </layout>
 </appender>
  <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
    <param name="file" value="${user.dir}/logs/kettle.log" />
    <param name="Append" value="false"/>
    <param name="MaxFileSize" value="10000KB"/>
    <param name="MaxBackupIndex" value="10"/> 
    <param name="encoding" value="UTF-8" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d{MM/dd HH:mm:ss.SSS}  %5p [%t] (%F:%L) -%m%n" />
    </layout>
  </appender>
  <root>
    <level value="INFO" />
     <appender-ref ref="FILE" />
  </root>
  <category name="org.pentaho.di" additivity="false">
    <priority value="INFO"/>
    <appender-ref ref="FILE"/>
  </category>

</log4j:configuration>



版权声明:本文为luyinxing1原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。