How to change Log4j PatternLayout in the Project Settings to display a DateTime value on logs?


How to change the Log4j pattern layout in the Project Settings to display a DateTime value in logs?



The project settings use Log4j. To change them, open the project in Studio and select File > Edit Project Properties.

Then in the Project Settings window, select Log4j. This is where the PatternLayout value can be edited as desired.

2017-10-13 08_34_34-Talend Data Fabric ( _ admin, admin _ git (Connection_ Remot.png

To get output as shown below:

[INFO ] - 13 Oct 2017 08:19:47:443 - TalendJob: 'Parent' - Start.

Change log4j project setting to:

<!-- CONSOLE appender -->
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
   <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern"
         value="[%-5p] - %d{dd MMM yyyy HH:mm:ss:SSS} - %m%n" />

See the following documentation for the available Patterns: Apache Log4j Class PatternLayout

Version history
Revision #:
3 of 3
Last update:
‎09-29-2018 12:12 AM
Updated by:
Labels (3)