All,

We are using PDI-4.0.1 and planning to migrate to PDI-5.0.1 . We are using log4j for logging.

As from the current version(5.0.1) , PDI is no longer using log4j as a back end and is providing log4j as a plug-able component , our logging is not working after the migration.

We are using a log4j.xml file for specifying the logging parameters , I tried a lot of possibilities but none of them seem to work properly.

Finally I tried up using the appender present in the class "org.pentaho.di.core.logging.Log4jFileAppender" but nothing has helped me so far , I am struggling with this for the past few days . but it throws below error :
"log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.InstantiationException: org.pentaho.di.core.logging.Log4jFileAppender"

Here is the XML file (log4j.xml) :

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

<!-- ============================== -->
<!-- Append messages to the console -->
<!-- ============================== -->

<appender name="CONSOLE" class="org.pentaho.di.core.logging.Log4jConsoleAppender">

<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
</layout>

</appender>

<appender name="ETLJOB" class="org.pentaho.di.core.logging.Log4jFileAppender">


</appender>

<category name="org.pentaho.di" additivity="false">
<priority value="ALL"/>
<appender-ref ref="ETLJOB"/>
</category>

<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
<root>
<priority value="debug"/>
<appender-ref ref="CONSOLE"/>
</root>

</log4j:configuration>

The log4j.xml file which was working earlier with 4.0.1 is given below :

<?xml version="1.0" encoding="UTF-8"?>
<!--
@COPYRIGHT
Team Forge (r) Enterprise Edition
Copyright 2010 CollabNet, Inc. All rights reserved.
http://www.collab.net
COPYRIGHT@
-->

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<!-- ===================================================================== -->
<!-- -->
<!-- SFEE ETL Server Webapp Log4j Configuration -->
<!-- -->
<!-- ===================================================================== -->

<!-- $Id: log4j.xml.tmpl,v 1.8 2007/05/24 00:36:19 ewu Exp $ -->

<!--
| For more configuration infromation and examples see the Jakarta Log4j
| owebsite: http://jakarta.apache.org/log4j
-->

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

<!-- ============================== -->
<!-- Append messages to the console -->
<!-- ============================== -->

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="ERROR"/>
<param name="Target" value="System.out"/>

<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
</layout>
</appender>

<!-- Another rolling appender, for com.vasoftware.etl packages -->
<appender name="ETL" class="org.apache.log4j.FileAppender">
<param name="File" value="${etl.logdir}/etl.log"/>

<param name="Append" value="true"/>
<param name="MaxFileSize" value="100MB"/>

<param name="ImmediateFlush" value="true"/>
<param name="BufferedIO" value="false"/>

<layout class="org.apache.log4j.PatternLayout">
<!-- Extended pattern: Date Priority [Category][SessionID] Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c{1}] %m%n"/>
</layout>
</appender>

<!-- Another rolling appender, for com.vasoftware.etl.scheduler packages -->
<appender name="ETLJOB" class="org.apache.log4j.FileAppender">
<param name="File" value="${etl.logdir}/etl.log"/>

<param name="Append" value="true"/>
<param name="MaxFileSize" value="100MB"/>

<param name="ImmediateFlush" value="true"/>
<param name="BufferedIO" value="false"/>

<layout class="org.apache.log4j.PatternLayout">
<!-- Extended pattern: Date Priority [Category][SessionID] Message\n -->
<param name="ConversionPattern" value="%d %-5p [%t] %m%n"/>
</layout>
</appender>

<!-- Associate VA-specific appender with com.vasoftware.etl loggers -->
<category name="com.vasoftware.sf.etl">
<priority value="WARN"/>
<appender-ref ref="ETL"/>
</category>
<category name="com.vasoftware.sf.etl.scheduler.job" additivity="false">
<priority value="INFO"/>
<appender-ref ref="ETLJOB"/>
</category>


-->
<category name="org.pentaho.di" additivity="false">
<priority value="ERROR"/>
<appender-ref ref="ETLJOB"/>
</category>

<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
<root>
<appender-ref ref="CONSOLE"/>
</root>

</log4j:configuration>



Can anyone please help me here.

thanks and regards,
Pradeep