日志文件中的日期格式PDI / Kitchen 4.0.1

时间:2012-01-16 17:45:00

标签: pentaho kettle

继承了一组作业,对文件系统的记录以格式{SEV} MM-dd HH:MM:SS开头,我需要将年份作为时间戳的一部分。

我能找到的唯一log4j配置是旧的Jasper安装的一部分,修改它们使用log4j.appender.fileout.layout.conversionPattern =%d {yyyy-MM-dd}而不是ISO8601作为测试似乎没有效果。

还可以在哪里定义日志行格式?

1 个答案:

答案 0 :(得分:1)

在数据集成4.2.1中:

Index: src/log4j.xml
===================================================================
--- src/log4j.xml   (revision 16273)
+++ src/log4j.xml   (working copy)
@@ -32,7 +32,7 @@
          I imagine it gets cached and reused throughout the life of the application). 
          
          -->
-         
+         
       
    

Index: src-core/org/pentaho/di/core/logging/LogWriter.java
===================================================================
--- src-core/org/pentaho/di/core/logging/LogWriter.java (revision 16273)
+++ src-core/org/pentaho/di/core/logging/LogWriter.java (working copy)
@@ -101,7 +101,7 @@
         // Play it safe, if another console appender exists for org.pentaho, don't add another one...
         //
         if (!consoleAppenderFound) {
-           Layout patternLayout = new PatternLayout("%-5p %d{dd-MM HH:mm:ss,SSS} - %m%n");
+           Layout patternLayout = new PatternLayout("%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} - %m%n");
            ConsoleAppender consoleAppender = new ConsoleAppender(patternLayout);
            consoleAppender.setName(STRING_PENTAHO_DI_CONSOLE_APPENDER);
            pentahoLogger.addAppender(consoleAppender);