• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Legacy log4J

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have inherited a project using Iplanet app server 3.5 that uses an archaic version of log4j. The application uses log4j and a custom class to log information to the app server log files. For tacking purposes, I need to move some log message from the app server log files, which only log warnings and errors, to a separate log file with a specific layout. I tried modifying the configuration to instantiate a new category based on a RollingFileAppender

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE configuration SYSTEM "log4j.dtd">

<configuration>

<!-- For performance logging -->
<appender name="RollingLogFileAppender" class="org.apache.log4j.RollingFileAppender">
<File value="C:\\logs\\tracking\\trends.log" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="_yyyyMMdd" />
<layout class="org.apache.log4j.PatternLayout">
<conversionPattern value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n" />
</layout>
</appender>

<appender name="AppServerAppender" class="com.tfeurope.j2eeframework.log4jintegration.IPlanetLogAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="[%t] %C{2} (%F:%L) - %m\n"/>
</layout>
</appender>

<root>
<priority value ="debug" />
<appender-ref ref="AppServerAppender" />
</root>

<!-- For performance logging -->
<category name="tracking" additivity="false">
<appender-ref ref="RollingLogFileAppender" />
</category>

</configuration>

but I see this error in the log files.
log4j:ERROR No output target set for appender named "RollingLogFileAppender".

What is the correct configuration syntax for my version of log4j?

Thanks,
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't mention the version of the archaic log4j version.

Did you try the syntax used on the wiki log4j XML format page?
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!