blob: 47ceeea3cbb2b4d081178c20eb5a575ad9adb2c7 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## copy and modify xml contents below to create a Chainsaw configuration ##
<?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="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="LogFileXMLReceiver" class="org.apache.log4j.xml.LogFileXMLReceiver">
<param name="fileURL" value="file:///c:/sample.xml"/>
<param name="name" value="sampleLogFileXMLReceiver"/>
<param name="tailing" value="true"/>
</plugin>
<plugin name="LogFileReceiver" class="org.apache.log4j.varia.LogFilePatternReceiver">
<param name="fileURL" value="file:///c:/sample.log"/>
<param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
<param name="logFormat" value="TIMESTAMP LEVEL [LOGGER] MESSAGE"/>
<param name="name" value="sampleLogFilePatternReceiver"/>
<param name="tailing" value="true"/>
</plugin>
<plugin name="VFSLogFilePatternReceiverWithUserInfoPrompt" class="org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver">
<param name="fileURL" value="sftp://192.168.0.100:///c:/sample.log"/>
<param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
<param name="logFormat" value="TIMESTAMP LEVEL [LOGGER] MESSAGE"/>
<param name="name" value="sampleLogFilePatternReceiver"/>
<param name="promptForUserInfo" value="true"/>
<param name="tailing" value="true"/>
</plugin>
<plugin name="VFSLogFilePatternReceiverNoUserInfoPrompt" class="org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver">
<param name="fileURL" value="sftp://user:password@192.168.0.100:///c:/sample.log"/>
<param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
<param name="logFormat" value="TIMESTAMP LEVEL [LOGGER] MESSAGE"/>
<param name="name" value="sampleLogFilePatternReceiver"/>
<param name="tailing" value="true"/>
</plugin>
<plugin name="CustomDBReceiver" class="org.apache.log4j.db.CustomSQLDBReceiver">
<connectionSource class="org.apache.log4j.db.DriverManagerConnectionSource">
<param name="password" value="somepassword"/>
<param name="user" value="someuser"/>
<param name="driverClass" value="org.gjt.mm.mysql.Driver"/>
<param name="url" value="jdbc:mysql://127.0.0.1/logs"/>
</connectionSource>
<param name="refreshMillis" value="5000"/>
<param name="sql" value='select logger as LOGGER, timestamp as TIMESTAMP, level as LEVEL, thread as THREAD, message as MESSAGE, ndc as NDC, mdc as MDC, class as CLASS, method as METHOD, file as FILE, line as LINE, concat("{{application,databaselogs,hostname,mymachine,log4jid,", COUNTER, "}}") as PROPERTIES, "" as EXCEPTION from logtable'/>
<param name="IDField" value="COUNTER"/>
</plugin>
<root>
<level value="debug"/>
</root>
</log4j:configuration>