logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bi...@dice.com
Subject RE: Questions about chainsaw2
Date Mon, 12 Jul 2004 22:50:33 GMT
Scott,

Thanks a lot for your help. Now it works. But it seems that the setting in
"app wide preferences" doesn't work (either forward slashes or backward
slashes). I have to manually select the xml file when chainsaw2 starts. Now
the tailing function works very well (I changed the backward slashes to
forward slashes in the xml file).

Thank you so much. Since there is little learning materials and examples
about how to configure the socket appender, if you know any further
resources available on the Internet. Please let me know.

Have a nice day.
Bing

-----Original Message-----
From: Scott Deboy [mailto:sdeboy@comotivsystems.com]
Sent: Monday, July 12, 2004 4:27 PM
To: Log4J Users List
Subject: RE: Questions about chainsaw2


The file-load from xml is meant to be used with log files saved in xml
format (using XmlLayout), so using the 'app wide preferences' auto
config field is the right way to go.  

Do a list of receivers defined in the config file show up (view menu,
show receivers)?

The log file pattern receiver is probably not finding your file because
of the path separator (I'll fix this but haven't had time yet).  

Change the path in the 'fileName' param to use forward slashes instead
of backward slashes..that should work.

Let me know if this fixes your problem.

Scott

-----Original Message-----
From: BingZ@dice.com [mailto:BingZ@dice.com] 
Sent: Monday, July 12, 2004 3:14 PM
To: log4j-user@logging.apache.org
Subject: RE: Questions about chainsaw2


Hi, Scott,

Thanks a lot for your reply. But it still didn't work with me. The
modified xml file is as follows: <?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="A2" class="org.apache.log4j.ConsoleAppender">
      <layout class="org.apache.log4j.SimpleLayout"/>
   </appender>

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

   <plugin name="XMLSocketReceiver"
class="org.apache.log4j.net.XMLSocketReceiver">
      <param name="decoder"
value="org.apache.log4j.xml.UtilLoggingXMLDecoder"/>
      <param name="Port" value="2222"/>
   </plugin>

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

   <plugin name="MulticastReceiver"
class="org.apache.log4j.net.MulticastReceiver">
      <param name="Port" value="4449"/>
      <param name="Address" value="224.1.1.1"/>      

   </plugin>

	<plugin name="patternFile"
class="org.apache.log4j.varia.LogFilePatternReceiver">
	<param name="timestampFormat" value="yyyy-MM-d HH:mm:ss,SSS"/>
	<param name="logFormat" value="RELATIVETIME [THREAD] LEVEL
LOGGER *
- MESSAGE"/>
	<param name="fileName" value="C:\Program Files\Apache Software
Foundation\Tomcat 5.0\webapps\addFeaturedJobs2\WEB-INF\filelog.log"/>
	<param name="tailing" value="true"/>
   </plugin>

   <root>
      <level value="debug"/>
   </root>
</log4j:configuration>

But either I loaded this xml file using menu File->Load Log4J File or I
specified the absolute path the the xml file in "Application Wide
Preference" and restarted chainsaw2, nothing showed up. I build
chainsaw2 from the source code but it still didn't work. Any comments? 

BTW: Could you show me some simple examples about how to configure the
property file to let my logger class send logs to chainsaw2?

Thanks again.
Bing

-----Original Message-----
From: Scott Deboy [mailto:sdeboy@comotivsystems.com]
Sent: Monday, July 12, 2004 3:11 PM
To: Log4J Users List
Subject: RE: Questions about chainsaw2


Can you use an xml configuration file for Chainsaw?

If so, on the 'Welcome' tab, there's a 'View example Receiver
configuration' which shows an example XML file which can be used with
Chainsaw and loads a number of receivers.  

Save the contents of this config to an .xml file on your drive, and add
this to the config file  (change the pattern to match the pattern in
your file):

   <plugin name="patternFile"
class="org.apache.log4j.varia.LogFilePatternReceiver">
	<param name="timestampFormat" value="yyyy-MM-d HH:mm:ss,SSS"/>
	<param name="logFormat" value="TIMESTAMP LEVEL [LOGGER]
MESSAGE"/>
	<param name="fileName" value="c:/server.log"/>
	<param name="tailing" value="true"/>
   </plugin>

Once you've created the config file, you can have it loaded
automatically:

View menu, show application preferences
Specify the path to the config file in the General-automatic
configuration field.

Hope this helps,
Scott

-----Original Message-----
From: BingZ@dice.com [mailto:BingZ@dice.com] 
Sent: Monday, July 12, 2004 1:54 PM
To: log4j-user@logging.apache.org
Subject: Questions about chainsaw2


Hi, 

I started using Log4J last week and was amazed by the tutorial of
chainsaw2. But I have difficulties while using chainsaw2. 1. Could
anybody please show me how to write a log4j.properties file to configure
the appender to send logs to the chainsaw2? 
2. I use chainsaw2 to import and view a local log file. But I could not
set the tailing property to true which means chainsaw2 can't be aware of
the changing of the log file. Did I do something wrong?

Thanks in advance.
Bing

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message