How to start using a chainsaw for Log4j?

I would like to start using Chainsaw v2. Almost none of this. I found only this one , but the links cannot be opened, so it is unclear.

I am using socketAppender:

log4j.rootLogger=DEBUG, server log4j.appender.server=org.apache.log4j.net.SocketAppender log4j.appender.server.Port=4712 log4j.appender.server.RemoteHost=localhost log4j.appender.server.ReconnectionDelay=10000 

I created a log4j.xml file

 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration > <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="4712"/> </plugin> <root> <level value="debug"/> </root> </log4j:configuration> 

And select it in let me search for configuration file . But there are no magazines. What should I do next?

+6
source share
3 answers

I am one of the authors of Chainsaw. Try the latest Chainsaw developer snapshot, which will be released shortly. It has a new configuration user interface that should make it a lot easier to configure, especially if all you do is use a socket application.

There are many new features in this version. Feel free to write emails or send messages to the log4j mailing list.

A snapshot of the developer is available here: http://people.apache.org/~sdeboy

Scott

+2
source

Use only one log4j.properties or log4j.xml file. And check out this article for a chainsaw. This may be useful for you.

This is an example log4j.properties file for Chainsaw,

  log4j.rootCategory=DEBUG, zeroconf, chainsaw # Socket Appender log4j.appender.chainsaw=org.apache.log4j.net.SocketAppender log4j.appender.chainsaw.remoteHost=localhost log4j.appender.chainsaw.port=4445 log4j.appender.chainsaw.locationInfo=true 
0
source

To start the server first, in the receiver of the log server, you can select the first socket receiver.

log4j.rootLogger = DEBUG, CHAINSAW_CLIENT

log4j.appender.CHAINSAW_CLIENT = org.apache.log4j.net.SocketAppender log4j.appender.CHAINSAW_CLIENT.RemoteHost = local log4j.appender.CHAINSAW_CLIENT.Port = 4445
log4j.appender.CHAINSAW_CLIENT.LocationInfo = TRUE

0
source

Source: https://habr.com/ru/post/922016/


All Articles