-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlog4j.properties
52 lines (41 loc) · 2.32 KB
/
log4j.properties
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
# 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.
# For the general syntax of property based configuration files see the
# documenation of org.apache.log4j.PropertyConfigurator.
# The root category uses the appender called A1. Since no priority is
# specified, the root category assumes the default priority for root
# which is DEBUG in log4j. The root category is the only category that
# has a default priority. All other categories need not be assigned a
# priority in which case they inherit their priority from the
# hierarchy.
log4j.rootCategory=DEBUG,A1,A2
#TRACE,DEBUG,INFO,WARN,ERROR,FATAL
#打印到控制台
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
#ConversionPattern的值可参考org.apache.log4j.PatternLayout介绍
#t Used to output the name of the thread that generated the logging event.
#d 输出时间
log4j.appender.A1.layout.ConversionPattern= [YHEF-TOOLS] %d %p [%t] %C.%M(%L) | %m%n
#输出到日志文件
#RollingFileAppender,如果日志文件的大小达到MaxFileSize设置的值,则会产生一个tools.log.1做备份,然后继续写日志到tools.log
#2个文件的大小几乎差不多,之前的日志信息会被覆盖掉,类似Oracle的 redo日志文件,循环写†™
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern= [YHEF-TOOLS] %d- [Log4j] %p %t %c - %m%n
log4j.appender.A2.File=D:/eclipse_log/struts2.log
log4j.appender.A2.MaxFileSize=2KB
#单独设置某个包下的输出级别
#log4j.logger.com.yhef=INFO