[resolved] XML file parsing error[Solved]

One Star

[resolved] XML file parsing error[Solved]

Hi all,
I have been having this error since I tried to use a Log4j configuration file to generate logs.
Please find below a screenshot of the error.
Thank you,

Accepted Solutions
One Star

Re: [resolved] XML file parsing error[Solved]

Hi again,
My problem is fixed now. It actually was a simple blank space before my XML declaration.
I am though open to any suggestions or good practice material you may have and that I can use to enhance my config file or the way I handle the logs.

All Replies
One Star

Re: [resolved] XML file parsing error[Solved]

How are you configuring your job to do logging with log4j?
Seventeen Stars

Re: [resolved] XML file parsing error[Solved]

Hi willm,
there are some user components in Talend Exchange to do that.
@Med: Please show us the XML you have tried to parse. In fact in your xml is an error but we could not find it without seeing the xml.
One Star

Re: [resolved] XML file parsing error[Solved]

Hello,
Sorry for not giving enough elements to help you understand my problem.
Please find below two screenshots that illustrate the way I'm logging my job.
And this is my log4j config file that's most likely causing my parsing issue.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Log4j Configuration - For more configuration information and examples see
the Jakarta Log4j - website: http://jakarta.apache.org/log4j

<appender name="FILE" class="org.apache.log4j.FileAppender">
<errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler" />
<param name="File" value="/opt/application/86acrm/logs/crmuser_sync/crmuser-sync-ICO1.log" />
<param name="Append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %m%n"/>
</layout>
</appender>

<!-- ================= -->
<!-- Gather errors in a local file -->
<!-- ==================-->
<appender name="ERROR-FILE" class="org.apache.log4j.FileAppender">
<errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler" />
<param name="File" value="/opt/application/86acrm/logs/crmuser_sync/crmuser-sync-ICO1-error.log" />
<!-- <param name="File" value="C:/Users/a577189/Desktop/outTalend/crmuser-sync-ICO1-error.log" /> -->
<param name="Append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601} %-5p %m%n" />
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="levelMin" value="ERROR"/>
</filter>
</appender>
<!-- ===================== -->
<!-- Append messages to the console -->
<!-- ===================== -->
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler" />
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %m%n" />
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="levelMin" value="WARN"/>
</filter>
</appender>

<!-- ================ -->
<!-- Setup the Root category -->
<!-- ================ -->

<root>
<level value="DEBUG" />
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
<appender-ref ref="ERROR-FILE" />
</root>
</log4j:configuration>

Thank you,
One Star

Re: [resolved] XML file parsing error[Solved]

Hi again,
My problem is fixed now. It actually was a simple blank space before my XML declaration.
I am though open to any suggestions or good practice material you may have and that I can use to enhance my config file or the way I handle the logs.