-
Notifications
You must be signed in to change notification settings - Fork 54
/
logging.properties
88 lines (58 loc) · 5.23 KB
/
logging.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
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
################################################################################
# LogManager
# 参见 java.util.logging.LogManager 的 javadoc
################################################################################
# The global logging properties may include:
#
# A property "handlers". This defines a whitespace or comma separated list of class names for handler classes to load and register as handlers on the root Logger (the Logger named ""). Each class name must be for a Handler class which has a default constructor. Note that these Handlers may be created lazily, when they are first used.
handlers = java.util.logging.ConsoleHandler java.util.logging.FileHandler
## A property "<logger>.handlers". This defines a whitespace or comma separated list of class names for handlers classes to load and register as handlers to the specified logger. Each class name must be for a Handler class which has a default constructor. Note that these Handlers may be created lazily, when they are first used.
# 就不单独针对类日志器设置了,采用 root Logger 的设置
# net_maclife_wechat_http_BotApp.handlers = java.util.logging.ConsoleHandler java.util.logging.FileHandler
# All properties whose names end with ".level" are assumed to define log levels for Loggers. Thus "foo.level" defines a log level for the logger called "foo" and (recursively) for any of its children in the naming hierarchy. Log Levels are applied in the order they are defined in the properties file. Thus level settings for child nodes in the tree should come after settings for their parents.
# The property name ".level" can be used to set the level for the root of the tree.
.level = INFO
# A property "config". This property is intended to allow arbitrary configuration code to be run. The property defines a whitespace or comma separated list of class names. A new instance will be created for each named class. The default constructor of each class may execute arbitrary code to update the logging configuration, such as setting logger levels, adding handlers, adding filters, etc.
# yyyy-MM-dd HH:mm:ss.SSS [$LEVEL] $SOURCE: $message\n
java.util.logging.SimpleFormatter.format = %1$tF %1$tT.%1$tL [%4$s] %2$s: %5$s%n
################################################################################
# 日志输出到控制台/终端
# java.util.logging.ConsoleHandler
################################################################################
# <handler-name>.level specifies the default level for the Handler (defaults to Level.INFO).
# 垃圾 java.util.logging 非要把 Handler 和 Logger 的 level 分开处理,tm 有病么
java.util.logging.ConsoleHandler.level = ALL
## <handler-name>.filter specifies the name of a Filter class to use (defaults to no Filter).
# java.util.logging.ConsoleHandler.filter =
## <handler-name>.formatter specifies the name of a Formatter class to use (defaults to java.util.logging.SimpleFormatter).
#java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
## <handler-name>.encoding the name of the character set encoding to use (defaults to the default platform encoding).
#java.util.logging.ConsoleHandler.encoding = UTF-8
################################################################################
# 日志写文件
# java.util.logging.FileHandler
################################################################################
## <handler-name>.level specifies the default level for the Handler (defaults to Level.ALL).
## 垃圾 java.util.logging 非要把 Handler 和 Logger 的 level 分开处理,tm 有病么
#java.util.logging.FileHandler.level = ALL
## <handler-name>.filter specifies the name of a Filter class to use (defaults to no Filter).
# java.util.logging.FileHandler.filter =
# <handler-name>.formatter specifies the name of a Formatter class to use (defaults to java.util.logging.XMLFormatter).
# XML, fuckoff !!!
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
# <handler-name>.encoding the name of the character set encoding to use (defaults to the default platform encoding).
# 日志写文件就不用平台默认编码了,统一为 UTF-8
java.util.logging.FileHandler.encoding = UTF-8
# <handler-name>.limit specifies an approximate maximum amount to write (in bytes) to any one file. If this is zero, then there is no limit. (Defaults to no limit).
# 10485760 = 10M = 10 * 1024 * 1024
# 20971520 = 20M = 20 * 1024 * 1024
#java.util.logging.FileHandler.limit = 20971520
## <handler-name>.count specifies how many output files to cycle through (defaults to 1).
#java.util.logging.FileHandler.count =
# 无法配置为日志文件不循环的数值,只好配置为 10000000,但 10000000 会导致在启动时 java 进程 CPU 占用率 100% !!! Fuck java.util.logging.FileHandler
#java.util.logging.FileHandler.count = 10000000
# <handler-name>.pattern specifies a pattern for generating the output file name. See below for details. (Defaults to "%h/java%u.log").
java.util.logging.FileHandler.pattern = logs/wechat-bot-engine-%g.log
# <handler-name>.append specifies whether the FileHandler should append onto any existing files (defaults to false).
# 默认不附加日志 -- 覆盖日志,这样导致没法记录历史日志,改改改
java.util.logging.FileHandler.append = true