Search code examples
pentahokettle

Format of dates in log files PDI / Kitchen 4.0.1


Inherited a set of jobs, and the logging to the filesystem begins with format {SEV} MM-dd HH:MM:SS, where I need to have the year as part of the timestamp.

The only log4j configs I can find are part of an old Jasper install, and modifying them to use log4j.appender.fileout.layout.conversionPattern=%d{yyyy-MM-dd} instead of ISO8601 as a test seems to have no effect.

Where else could the log line format be defined?


Solution

  • In Data Integration 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);