author | dfuchs |
Wed, 18 Jan 2017 11:47:36 +0000 | |
changeset 43186 | 1c192219e3dd |
permissions | -rw-r--r-- |
43186
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
1 |
############################################################ |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
2 |
# Global properties |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
3 |
############################################################ |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
4 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
5 |
# "handlers" specifies a comma separated list of log Handler |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
6 |
# classes. These handlers will be installed during VM startup. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
7 |
# Note that these classes must be on the system classpath. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
8 |
# By default we only configure a ConsoleHandler, which will only |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
9 |
# show messages at the INFO and above levels. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
10 |
handlers= java.util.logging.ConsoleHandler |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
11 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
12 |
# To also add the FileHandler, use the following line instead. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
13 |
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
14 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
15 |
# Default global logging level. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
16 |
# This specifies which kinds of events are logged across |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
17 |
# all loggers. For any given facility this global level |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
18 |
# can be overriden by a facility specific level |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
19 |
# Note that the ConsoleHandler also has a separate level |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
20 |
# setting to limit messages printed to the console. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
21 |
.level= INFO |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
22 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
23 |
############################################################ |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
24 |
# Handler specific properties. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
25 |
# Describes specific configuration info for Handlers. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
26 |
############################################################ |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
27 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
28 |
# default file output is in user's home directory. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
29 |
java.util.logging.FileHandler.pattern = %h/java%u.log |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
30 |
java.util.logging.FileHandler.limit = 50000 |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
31 |
java.util.logging.FileHandler.count = 1 |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
32 |
# Default number of locks FileHandler can obtain synchronously. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
33 |
# This specifies maximum number of attempts to obtain lock file by FileHandler |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
34 |
# implemented by incrementing the unique field %u as per FileHandler API documentation. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
35 |
java.util.logging.FileHandler.maxLocks = 100 |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
36 |
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
37 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
38 |
# Limit the message that are printed on the console to INFO and above. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
39 |
java.util.logging.ConsoleHandler.level = INFO |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
40 |
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
41 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
42 |
# Example to customize the SimpleFormatter output format |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
43 |
# to print one-line log message like this: |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
44 |
# <level>: <log message> [<date/time>] |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
45 |
# |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
46 |
# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
47 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
48 |
############################################################ |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
49 |
# Facility specific properties. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
50 |
# Provides extra control for each logger. |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
51 |
############################################################ |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
52 |
|
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
53 |
# For example, set the com.xyz.foo logger to only log SEVERE |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
54 |
# messages: |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
55 |
com.xyz.foo.level = SEVERE |
1c192219e3dd
8172886: Add a test that shows how the LogManager can be implemented by a module
dfuchs
parents:
diff
changeset
|
56 |
com.xyz.foo.handlers = test.handlers.TestHandler |