2012-01-16 50 views
4

繼承了一組作業,並且以格式{SEV} MM-dd HH:MM:SS開始以文件系統的日誌記錄開始,其中我需要將年部分時間戳。日誌文件中的日期格式PDI/Kitchen 4.0.1

我能找到的唯一log4j配置是舊Jasper安裝的一部分,並且修改它們以使用log4j.appender.fileout.layout.conversionPattern =%d {yyyy-MM-dd}而不是ISO8601作爲測試沒有效果。

哪裏可以定義日誌行格式?

回答

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);