summaryrefslogtreecommitdiff
blob: 13f403a3456085649f8a214e1e0c9a7851a2b6cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  Log4j Configuration                                                  -->
<!--                                                                       -->
<!-- ===================================================================== -->

<!-- $Id: log4j.xml,v 1.1 2004/08/08 17:14:24 stuart Exp $ -->

<!--
   | For more configuration infromation and examples see the Jakarta Log4j
   | owebsite: http://jakarta.apache.org/log4j
 -->

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

  <!-- ================================= -->
  <!-- Preserve messages in a local file -->
  <!-- ================================= -->

  <!-- A time/date based rolling appender -->
  <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
    <param name="File" value="/var/log/jboss/server.log"/>
    <param name="Append" value="false"/>

    <!-- Rollover at midnight each day -->
<!--    <param name="DatePattern" value="'.'yyyy-MM-dd"/> -->

    <!-- Rollover at the top of each hour -->
    <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>

    <layout class="org.apache.log4j.PatternLayout">
      <!-- The default pattern: Date Priority [Category] Message\n -->
      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>

      <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
      <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
       -->

    </layout>	    
  </appender>

  <!-- A size based file rolling appender
  <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
    <param name="File" value="${jboss.server.home.dir}/log/server.log"/>
    <param name="Append" value="false"/>
    <param name="MaxFileSize" value="500KB"/>
    <param name="MaxBackupIndex" value="1"/>

    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
    </layout>	    
  </appender>
  -->

  <!-- ============================== -->
  <!-- Append messages to the console -->
  <!-- ============================== -->

  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
    <param name="Threshold" value="INFO"/>
    <param name="Target" value="System.out"/>

    <layout class="org.apache.log4j.PatternLayout">
      <!-- The default pattern: Date Priority [Category] Message\n -->
      <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
    </layout>
  </appender>


  <!-- ====================== -->
  <!-- More Appender examples -->
  <!-- ====================== -->

  <!-- Buffer events and log them asynchronously
  <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
    <appender-ref ref="FILE"/>
    <appender-ref ref="CONSOLE"/>
    <appender-ref ref="SMTP"/>
  </appender>
  -->

  <!-- EMail events to an administrator
  <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
    <param name="Threshold" value="ERROR"/>
    <param name="To" value="admin@myhost.domain.com"/>
    <param name="From" value="nobody@myhost.domain.com"/>
    <param name="Subject" value="JBoss Sever Errors"/>
    <param name="SMTPHost" value="localhost"/>
    <param name="BufferSize" value="10"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
    </layout>
  </appender>
  -->

  <!-- Syslog events
  <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
    <param name="Facility" value="LOCAL7"/>
    <param name="FacilityPrinting" value="true"/>
    <param name="SyslogHost" value="localhost"/>
  </appender>
  -->
 

  <!-- Log events to JMS (requires a topic to be created)
  <appender name="JMS" class="org.apache.log4j.net.JMSAppender">
    <param name="Threshold" value="ERROR"/>
    <param name="TopicConnectionFactoryBindingName" value="java:/ConnectionFactory"/>
    <param name="TopicBindingName" value="topic/MyErrorsTopic"/>
  </appender>
  -->

  <!-- ================ -->
  <!-- Limit categories -->
  <!-- ================ -->

  <!-- Limit JBoss categories to INFO
  <category name="org.jboss">
    <priority value="INFO"/>
  </category>
  -->

  <!-- Increase the priority threshold for the DefaultDS category
  <category name="DefaultDS">
    <priority value="FATAL"/>
  </category>
  -->

  <!-- Decrease the priority threshold for the org.jboss.varia category
  <category name="org.jboss.varia">
    <priority value="DEBUG"/>
  </category>
  -->

  <!--
     | An example of enabling the custom TRACE level priority that is used
     | by the JBoss internals to diagnose low level details. This example
     | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
     | subpackages. This will produce A LOT of logging output.
       If you use replace the log4j 1.2 jar with a 1.1.3 jar you will need to
       change this from XLevel to XPriority.
  <category name="org.jboss.system">
    <priority value="TRACE" class="org.jboss.logging.XLevel"/>
  </category>
  <category name="org.jboss.ejb.plugins">
    <priority value="TRACE" class="org.jboss.logging.XLevel"/>
  </category>
  -->

  <!-- ======================= -->
  <!-- Setup the Root category -->
  <!-- ======================= -->

  <root>
    <appender-ref ref="CONSOLE"/>
    <appender-ref ref="FILE"/>
  </root>
  
</log4j:configuration>