logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilfong, Paul" <paul.wilf...@ngc.com>
Subject Log4j XMLSocketReceiver plugin problem
Date Wed, 19 Sep 2007 00:00:34 GMT
I am migrating from log4j 1.3 to 1.2.15, trying to execute the
SimpleSocketReceiver with the XMLSocketReceiver as a plugin, and am
getting an "Unrecognized element" warning.

The following is the output to the Command Window...
log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j:WARN Unrecognized element plugin
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache] additivity to [true].
log4j: Level value for org.apache is  [INFO].
log4j: org.apache level set to INFO
log4j: Level value for root is  [ALL].
log4j: root level set to ALL
log4j: Class name: [org.apache.log4j.RollingFileAppender]
log4j: Setting property [append] to [false].
log4j: Setting property [file] to [C:/ttt/test.log].
log4j: Setting property [maxFileSize] to [50KB].
log4j: Setting property [maxBackupIndex] to [5].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %-5p
[%c{1}] %m%n].
log4j: setFile called: C:/ttt/test.log, false
log4j: setFile ended
log4j: Adding appender named [RF] to category [root].
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Parsing layout of class: "org.apache.log4j.TTCCLayout"
log4j: Adding appender named [CONSOLE1] to category [root].
[main] INFO org.apache.log4j.net.SimpleSocketServer - Listening on port
7777
[main] INFO org.apache.log4j.net.SimpleSocketServer - Waiting to accept
a new cl
ient.



Here is the properties file I use for the SimpleSocketReceiver...
<!-- log4jproperies.xml
     Setup for the SimpleSocketServer, with the XMLSocketReceiver to
help bring in log4cxx messages.
-->

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

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

<appender name="RF" class="org.apache.log4j.RollingFileAppender">
	<param name="Append" value="false"/>
	<param name="File" value="C:/ttt/test.log"/>
	<param name="MaxFileSize" value="50KB"/>
	<param name="MaxBackupIndex" value="5"/>
	<layout class="org.apache.log4j.PatternLayout">
		<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p
[%c{1}] %m%n"/>
	</layout>
</appender> 
<appender name="CONSOLE1" class="org.apache.log4j.ConsoleAppender">
	<layout class="org.apache.log4j.TTCCLayout"/>
</appender>  

<plugin name="XMLSocketReceiver"
class="org.apache.log4j.net.XMLSocketReceiver">
	<param name="Port" value="7776"/>
</plugin>

<logger name="org.apache">
	<level value="INFO"/>
</logger>

<root>
	<level value="ALL"/>
	<appender-ref ref="RF"/>
	<appender-ref ref="CONSOLE1"/>
</root>

</log4j:configuration>


And here is the DOS batch file I use to execute the
SimpleSocketReceiver...
@echo off
title 2run-1.2.15-SS.bat
java -classpath
"C:\usr\apache-log4j-1.2.15\log4j-1.2.15.jar";"C:\usr\log4j-1.2.15-compa
nions\component\target\apache-log4j-component-1.0-SNAPSHOT.jar";"C:\usr\
log4j-1.2.15-companions\receivers\target\apache-log4j-receivers-1.0-SNAP
SHOT.jar";"C:\usr\apache-log4j-extras-1.0\apache-log4j-extras-1.0.jar"
org.apache.log4j.net.SimpleSocketServer 7777
C:\usr\SimpleServer1.2.15\log4jproperties.xml
pause



I had been able to get this working under 1.3,  with some differences
for 1.2.15.  For example, I reordered the properties file to put logger
before <root>.  Also, I put the companion jars in the classpath on the
execution line in the batch file.  (This is all using JDK jdk1.6.0_02 on
Windows XP 2002.)

Any help with this would be greatly appreciated.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message