[wildfly-dev] Surprising logging configuration: enable just some logs?

Baptiste Mathus ml at batmat.net
Wed Nov 27 03:52:07 EST 2013


Hi guys,

[[I crawled the archive a bit, and wrote here as jboss-as-dev seems
inactive. If it's the wrong list here to talk about an old version of
jboss/wildfly, just let me know.]]

I was recently trying to customize the output of JBoss 7 (EAP6.1) in our
development environment.
We're currently seeing what IMO is far too many logs at the beginning of
the server (about 3.5k lines, and too many logs kills the logs :-)).

We'd like to configure the root-logger at ERROR level, and redefine our
root package at just WARN.
Then, we particularly want to keep two INFO logs from JBoss:
starting/finished starting[error or not].

15:47:29,652 INFO  [org.jboss.as.server.ApplicationServerService] [-][]
(MSC service thread 1-7) JBAS015899: JBoss EAP 6.1.1.GA <http://6.1.1.ga/> (AS
7.2.1.Final-redhat-10) démarre
15:48:00,789 INFO  [org.jboss.as.server.BootstrapListener] [-][]
(Controller Boot Thread) JBAS015874: JBoss EAP 6.1.1.GA <http://6.1.1.ga/> (AS
7.2.1.Final-redhat-10) a démarré en 32035ms - 5898 sur 6139 services ont
démarré (229 services sont passifs ou à la demande)

To achieve that, someone previously configured org.jboss.as logger at the
INFO level. BUT, as this is a parent package of almost anything in the
server, this seems to activate a lot of other logs (some from
org.jboss.as.clustering.foo, org.jboss.as.naming.bar to name a few).

So, I naively first tried configuring the FQN being displayed
org.jboss.as.server.ApplicationServerService and
org.jboss.as.server.BootstrapListener, and realized this did not change
anything.

After a quick look in the code, I saw that loggers in jboss/wildfly
actually don't seem to use the class the logs are being emitted from as
often elsewhere, but some specially Logger instances defined in some
central class (like
https://github.com/wildfly/wildfly/blob/7.1/server/src/main/java/org/jboss/as/server/ServerLogger.javafor
example).

ApplicationServerService [1] and BootstrapListener[2], for instance,
actually log the server through the ServerLogger.AS_ROOT_LOGGER[3] instance.

And AS_ROOT_LOGGER is "bound" to org.jboss.as... I'm stuck. I have to
activate org.jboss.as to see the starting logs, but at the same time
enabling other logs.
Btw, why do those logs get sent through ServerLogger.AS_ROOT_LOGGER (
org.jboss.as) instead of ServerLogger.ROOT_LOGGER (org.jboss.as.server)?
Was it actually made on purpose?

A possible solution I see might be to redefine some org.jboss.as.foo
package at a higher level than INFO in my standalone.xml, but this seems a
bit cumbersome.

Did I understand how logging inside as/wildfly work correctly? Do you see
another way to achieve what I say above?

Thanks a lot for any hint.

[1]
https://github.com/wildfly/wildfly/blob/7.1/server/src/main/java/org/jboss/as/server/ApplicationServerService.java#L96
[2]
https://github.com/wildfly/wildfly/blob/7.1/server/src/main/java/org/jboss/as/server/BootstrapListener.java#L157
 [3]
https://github.com/wildfly/wildfly/blob/7.1/server/src/main/java/org/jboss/as/server/ServerLogger.java#L66

-- Baptiste
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/wildfly-dev/attachments/20131127/847eee76/attachment.html 


More information about the wildfly-dev mailing list