Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
vitor_melo
Contributor
Contributor

Talend Studio log4j2 output in JSON

Greetings,

Is it possible to configure Talend Studio project preferences to output log4j2 into the JSON format?

I tried adding the jackson dependencies, as well as log4j2 in the project POM, edited the log4j template but I keep having the error:

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ser/FilterProvider

Any clue about how to solve it?

Labels (4)
2 Replies
Cá_Heo_Mập_Mạp
Contributor
Contributor

it's 2023, June, did you find solution to output log in json format?

Cá_Heo_Mập_Mạp
Contributor
Contributor

The alternative solution is using PatternLayout.

 

0695b00000kUerdAAC.png 

 

This is my log4j template

--- Start Code ---

<?xml version="1.0" encoding="UTF-8"?>

<Configuration >

<Appenders>

<Console name="Console" target="SYSTEM_OUT">

<PatternLayout >

<pattern>

{ 'timestamp':"%d{ISO8601}", 'level':"%level", 'category':"%c", 'message':"%enc{%m}{JSON}" }%n

</pattern>

</PatternLayout>

</Console>

</Appenders>

 

<Loggers>

<Root level="INFO">

<AppenderRef ref="Console" />

</Root>

</Loggers>

</Configuration>

 

--- End Code ---

 

For more detail, you can visit this link https://hexalink.xyz/talend/2023/06/21/Talend-How-to-export-log-in-JSON-Format.html