| 1 | # JDK Logger Monitor |
| 2 | |
| 3 | This extension provides a `Logger` which is an implementation of edc `Monitor` interface. It is based on `java.util.logging` package so it doesn't introduce any additional dependencies. As this extension is based on `MonitorExtension` which means this logger extension will load during the runtime initialization and all monitor logs (including edc core framework) will be forwarded to this logger. |
| 4 | |
| 5 | ## Usages |
| 6 | |
| 7 | To use this logger extension just add this monitor-jdk-logger extension package in your project dependency. |
| 8 | |
| 9 | ## Logging Configuration |
| 10 | |
| 11 | As this extension usages `java.util.logging` so to specify logger handler, format, level etc. provide a java properties file e.g. logging.properties |
| 12 | |
| 13 | ```text |
| 14 | handlers = java.util.logging.ConsoleHandler |
| 15 | .level = INFO |
| 16 | java.util.logging.ConsoleHandler.level = ALL |
| 17 | java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter |
| 18 | java.util.logging.SimpleFormatter.format = %1$tF %1$tT %4$s : %5$s %n |
| 19 | ``` |
| 20 | |
| 21 | To use this file pass it as jvm arguments `-Djava.util.logging.config.file=logging.properties` |
| 22 | |
| 23 | ## Know limitation |
| 24 | |
| 25 | A class level logger cannot be created as current Monitor interface methods does not have class as method arguments . So instead a global or extension level can be used. |