I am trying to configure log4j in an Eclipse plugin project using the following XML properties file, which includes the custom appender EclipseLoggingAppender:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <appender name="eclipseErrorView" class="com.lior.ibd.utils.logging.EclipseLoggingAppender"/> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %c{1} - %m%n"/> </layout> </appender> <root> <priority value ="debug" /> <appender-ref ref="console" /> </root> <logger name="com.lior"> <level value ="warn" /> <appender-ref ref="eclipseErrorView" /> </logger> </log4j:configuration>
I pass this property file to the following statement in the code:
DOMConfigurator.configure(filename);
But when loading the application, the following error message appears:
log4j:ERROR Could not create an Appender. Reported error follows. java.lang.ClassNotFoundException: com.lior.ibd.utils.logging.EclipseLoggingAppender
Does anyone know what the deal is? maybe a classpath problem? ..
java eclipse log4j
Protostome
source share