| 1 |
=== Logging === |
| 2 |
|
| 3 |
You can configure logging by using the Java -Dlog.config=filename option. |
| 4 |
This option uses a logging configuration file that allows you to enable and |
| 5 |
disable specific logging messages. This is useful if you want to see |
| 6 |
certain types of message that are not logged by default or choose where the |
| 7 |
messages should be written. The configuration file contains details of the |
| 8 |
handler(s) used to write the messages, parameters used to format the |
| 9 |
messages and the severity of messages that should be logged at Java package |
| 10 |
or class level, plus a default value. An example file is: |
| 11 |
|
| 12 |
# The default level FINE, WARNING, INFO, SEVERE |
| 13 |
.level=SEVERE |
| 14 |
#handlers: java.util.logging.ConsoleHandler |
| 15 |
handlers: java.util.logging.FileHandler java.util.logging.ConsoleHandler |
| 16 |
# package or class name with .level appended and then the level |
| 17 |
uk.me.parabola.imgfmt.level=INFO |
| 18 |
uk.me.parabola.mkgmap.build.level=INFO |
| 19 |
uk.me.parabola.mkgmap.main.Main.level=INFO |
| 20 |
uk.me.parabola.mkgmap.main.MapMaker.level=INFO |
| 21 |
uk.me.parabola.mkgmap.general.RoadNetwork.level=INFO |
| 22 |
uk.me.parabola.mkgmap.general.MapLine.level=INFO |
| 23 |
uk.me.parabola.mkgmap.osmstyle.level=INFO |
| 24 |
uk.me.parabola.mkgmap.reader.osm.level=INFO |
| 25 |
uk.me.parabola.mkgmap.reader.osm.xml.level=INFO |
| 26 |
uk.me.parabola.mkgmap.reader.osm.RestrictionRelation.level=FINE |
| 27 |
uk.me.parabola.mkgmap.reader.osm.Restriction.level=FINE |
| 28 |
# For ConsoleHandler |
| 29 |
java.util.logging.ConsoleHandler.level=WARNING |
| 30 |
java.util.logging.ConsoleHandler.formatter=uk.me.parabola.log.UsefulFormatter |
| 31 |
# For FileHandler |
| 32 |
java.util.logging.FileHandler.level=FINE |
| 33 |
java.util.logging.FileHandler.encoding=UTF-8 |
| 34 |
java.util.logging.FileHandler.formatter=uk.me.parabola.log.UsefulFormatter |
| 35 |
java.util.logging.FileHandler.limit=20000000 |
| 36 |
java.util.logging.FileHandler.count=4 |
| 37 |
java.util.logging.FileHandler.pattern=mkgmap.log |
| 38 |
java.util.logging.FileHandler.append=false |
| 39 |
|
| 40 |
The above example enables certain informational messages and sends them to a |
| 41 |
log file, with warning and error messages being also sent to stdout. |
| 42 |
|
| 43 |
Further information can be found at |
| 44 |
https://docs.oracle.com/javase/8/docs/technotes/guides/logging/overview.html |
| 45 |
|