Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
After moving to from 7.2 to Talend 8 we are facing some issues with Log4j2.
This topic is about the issue that when we are running a job on a server we can see the all the log details in the console, including the System.out.println messages. But when we check the logfile that is being produced we only see logging from the components themselves and no specific System.out.println messages.
Does anyone have experience with this?
Below is the log4j2.xml template that we are using, it looks very similar to the one we used in 7.2 (where the logging was being written to the file correctly)
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<RollingFile name="rollingFile" fileName="/location/logfile.log" filePattern="/location/logfile.log.%i" ignoreExceptions="false" append="true" locking="true" >
<PatternLayout>
<Pattern>%d | %5p | %c{1} |%X{jobId}|%X{jobName}|%X{version}| %m%n</Pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="10MB" />
</Policies>
<DefaultRolloverStrategy max="5"/>
</RollingFile>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d | %5p | %c{1} |%X{jobInstanceId}|%X{jobName}|%X{version}| %m%n"/>
</Console>
</Appenders>
<Loggers>
<!-- <Logger name="org.apache.log4j.xml" level="info"/> -->
<Root level="info">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="rollingFile"/>
</Root>
</Loggers>
</Configuration>
Thanks!
Hello,
What's log4j2 version you are using in talend 8? Maybe in V 7.2 you are using deprecated log4j2 version and the logs are parsed for the messages printed using the System.out.println to send out Pager Duty Alerts.
Here is a tjoblog component which is used in Jobs to debug their execution and decide what type of log information to send to the Studio or Talend Cloud user.
https://help.talend.com/r/en-US/8.0/talend-cloud/tjoblog
Best regards
Sabrina
hi,
I am using version log4j2 2.17.1
next to that I am not using Talend Cloud, instead we are on TAC. So that component is not fit for my use case I guess.
Please let me know how to capture System.out.println logs into the log file using Log4j 2.17.1
Thanks.
Hello,
With your subscription solution, could you please raise a support case on talend support portal? In this way, our colleagues from support team will check your issue and use case to see if a patch will be needed.
Best regards
Sabrina
Hi , we are also encountering this when migrating our jobs from 7.2.1 to 8.0.1
The logs showing in TMC are only from each components, not the specific system.out.println() messages that we have throughout the job where we sometimes print out helpful information to help debugging
Is there any update in relation to this topic ?
Hello,
Here is a tjoblog component which is used in Jobs to debug their execution and decide what type of log information to send to the Studio or Talend Cloud user.
https://help.talend.com/r/en-US/8.0/talend-cloud/tjoblog
Hope it helps.
Best regards
Sabrina