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

发布于 2024-12-27 05:11:54 字数 231 浏览 3 评论 0原文

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

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

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原野 2025-01-03 05:11:54

在数据集成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);

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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文