[Hawkular-dev] jboss logging PR ready for merge to h-parent

John Mazzitelli mazz at redhat.com
Fri Jan 30 20:39:15 EST 2015


OK, I've got a PR into the hawkular-parent-pom repo - once someone reviews and merges that for me (*cough cough* *hint hint*), it means we have JBoss Logging processing enabled for Hawkular. Take a look here to see what had to get done (it just involved a maven plugin "org.bsc.maven:maven-processor-plugin")

https://github.com/hawkular/hawkular-parent-pom/pull/6

To use the jboss logging processor, your maven project's pom needs to have hawkular-parent as its root parent. Once you do that, you need two dependencies on your pom - jboss-logging itself (obviously) and the jboss-logging-annotations which gives you the logging annotations like @MessageLogger, @LogMessage, etc. These are the two you need:

<dependency>
  <groupId>org.jboss.logging</groupId>
  <artifactId>jboss-logging</artifactId>
</dependency>

<dependency>
  <groupId>org.jboss.logging</groupId>
  <artifactId>jboss-logging-annotations</artifactId>
  <scope>provided</scope>
</dependency>

Here's what a typical logging interface looks like - if interested. This is how you define the i18n messages with ID numbers:

https://github.com/hawkular/hawkular-bus/blob/master/hawkular-bus-common/src/main/java/org/hawkular/bus/common/log/MsgLogger.java

Notice I'm only assigning IDs to INFO through ERROR levels (not for DEBUG or TRACE).

Once hawkular-parent merges my PR, I'll merge my own PR I have waiting in hawkular-bus so it can just use hawkular-parent's jboss logging process stuff.


More information about the hawkular-dev mailing list