Simple adapter to use LogEntries' AsyncLogger with Wildfly
The class com.logentries.jul.LogentriesHandler have the token property as a byte[] and I dont know how to set the token as a byte[] in the Wildfly configuration
-
On logentries website, create a new log and have the token available.
-
Build the jar:
mvn clean install
-
Create an a new Wildfly module with the Wildfly CLI:
module add --name=com.upplication.logentries --resources=$LOGENTRIES_JAR_PATH_WITH_DEPENDENCIES --dependencies=javax.api,org.jboss.logging
-
Create a custom handler:
/subsystem=logging/custom-handler=logentries:add(class=us.bigd.logentries.LogEntriesAdapterHandler, module=com.upplication.logentries, formatter="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n", properties={token="$YOUR_TOKEN"})
-
Add handler to root-logger
/subsystem=logging/root-logger=ROOT:root-logger-assign-handler(name="logentries") /subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="INFO")
-
Fire up Wildfly and monitor logs to confirm the module loads without errors.
-
Monitor logentries log for incoming data.