Four Stars

TOS 6.4.1 for Data Integration under Linux - Problems with log4j, no value for TalendJob.log



I use TOS 6.4.1 under Ubuntu Linux.


My log4j.xml file is as follows:


<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j='' >
      <!--  CONSOLE appender  -->
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
             <!--         <param name="ConversionPattern"      value="[%-5p]: %c - %m%n" />  -->
             <param name="ConversionPattern"  value="%d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %c{1}:%L - %m%n" />
    <!-- DRFILE appender example -->
    <appender name="DRFILE" class="org.apache.log4j.DailyRollingFileAppender">         
       <param name="file" value="${TalendJob.log}"/>
       <param name="DatePattern" value="'.'yyyy-MM-dd" />
       <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern"  value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5p %c{1}:%L - %m%n" />
    <!-- Spring Logger -->   
    <logger name="">   
        <level value="WARN" />   
        <appender-ref ref="CONSOLE"/>
    <!-- throwableRenderer <throwableRenderer class="org.apache.log4j.EnhancedThrowableRenderer"/>-->  
    <!-- logstash appender -->
      <!-- <appender name="LOGSTASH" class="">
          <param name="RemoteHost" value="localhost"/>
          <param name="Port" value="8052"/>
    </appender> -->
    <!-- Root Logger -->   
        <priority value ="INFO"/>
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="DRFILE"/>   
        <!-- <appender-ref ref="LOGSTASH"/> -->


I' not sure if the log4j.xml file is correct, and I use tInitLog4J und tLog4J from Talend Exchange. By the way, do these Components work 100% correctly with TOS 6.4.1.


When I run my Talend Job, I get the following error:


Starting job MyJob at 14:10 05/01/2018.

[statistics] connecting to socket on port 4024
[statistics] connected
log4j:ERROR setFile(null,true) call failed.  (No such file or directory)
	at Method)
	at org.apache.log4j.FileAppender.setFile(
	at org.apache.log4j.FileAppender.activateOptions(
	at org.apache.log4j.DailyRollingFileAppender.activateOptions(
	at org.apache.log4j.config.PropertySetter.activate(
	at org.apache.log4j.xml.DOMConfigurator.parseAppender(
	at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(
	at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(
	at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(
	at org.apache.log4j.xml.DOMConfigurator.parseRoot(
	at org.apache.log4j.xml.DOMConfigurator.parse(
	at org.apache.log4j.xml.DOMConfigurator.doConfigure(
	at org.apache.log4j.xml.DOMConfigurator.doConfigure(
	at org.apache.log4j.xml.DOMConfigurator.configure(
	at org.courtine.talend.log4j.TalendLog4JConfigurator.configureLog4J(
	at <...>.tInitLog4J_1Process(
	at <...>.tPrejob_1Process(
	at <...>.runJobInTOS(
	at <...>.main(
log4j:ERROR Either File or DatePattern options are not set for appender [DRFILE].

What is wrong?





Re: TOS 6.4.1 for Data Integration under Linux - Problems with log4j, no value for TalendJob.log


How did you set the field 'Path to the Log4J configuration file'? Does it exist on your local machine?

Best regards


Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.