Talend, How to export log in JSON Format?
21/06/2023
@ Saigon
Talend
Step 1: Go to File → Project Properties
Step 2: Go to log4j section and Activate log4j in components (Log4j version: log4j2)
In the Log4j template, use the following template.
Step 3: Create tJava in Talend Job to export log
- Basic settings code:
- Advanced settings code:
You then can RUN your talend job, the output should look like the following.
References
- Configure PatternLayout, jmcollin92, 2021, May 24, https://stackoverflow.com/questions/29387007/does-log4j-support-json-format#comment119606534_37455869.
- Handle special character in json log message, Nishan B, 2022, November 25, https://stackoverflow.com/questions/29387007/does-log4j-support-json-format#comment131629876_37455869.