Java Logging Handler which publishes log records to Windows Event Log
The library is available on Maven central. You can start to use the library by adding it to dependencies
section of pom.xml
:
<dependencies>
<!-- ... -->
<dependency>
<groupId>com.github.nikolaybespalov</groupId>
<artifactId>jul4nt</artifactId>
<version>${jul4nt.version}</version>
<scope>runtime</scope>
</dependency>
<!-- ... -->
</dependencies>
Or use it in build.gradle
:
dependencies {
// ...
runtime("com.github.nikolaybespalov:jul4nt:{jul4nt.version}")
// ...
}
Now you can use the logging configuration file with the following options:
#
handlers = com.github.nikolaybespalov.jul4nt.EventLogHandler
# Specifies the default level for the Handler (defaults to Level.INFO)
com.github.nikolaybespalov.jul4nt.EventLogHandler.level = Level.SEVERE
# Specifies the name of a Filter class to use (defaults to no Filter)
com.github.nikolaybespalov.jul4nt.EventLogHandler.filter =
# Specifies the name of a Formatter class to use (defaults to internal implementation)
com.github.nikolaybespalov.jul4nt.EventLogHandler.formatter = java.util.logging.SimpleFormatter
# The name of the character set encoding to use (defaults to the default platform encoding)
com.github.nikolaybespalov.jul4nt.EventLogHandler.encoding = UTF-8
# The name of the Source Name to use (defaults to EventLogHandler)
com.github.nikolaybespalov.jul4nt.EventLogHandler.sourceName = My Application
# Allows automatically create the required registry key (defaults to true)
com.github.nikolaybespalov.jul4nt.EventLogHandler.autoCreateRegKey = true
# Allows automatically delete the required registry key (defaults to false)
com.github.nikolaybespalov.jul4nt.EventLogHandler.autoDeleteRegKey = false
Or use the above-described configuration properties as system properties. For example:
-Dcom.github.nikolaybespalov.jul4nt.EventLogHandler.sourceName="My Application"
An example of using the jul4nt