I need to change the way JBoss prints out the log level into the log file, showing only the first character of the log level label, so that
19:13:01,183 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 61) Initializing Mojarra 2.2.12-jbossorg-2 ...
will become
19:13:01,183 I [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 61) Initializing Mojarra 2.2.12-jbossorg-2 for context '/MONService'
I tried some combination of formatting strings but I am unable to get only the first character.
I refered to the JBoss EAP 7 documentation (https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html/configuration_guide/logging_with_jboss_eap) and the Formatter javadoc (http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html) but was unable to find any viable solution.
Could anybody help?
Thanks
I tried this format and it works (for JBoss AS 7.5 at least):
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %1.1p [%c] (%t) %s%E%n"/>
This is configured in the standalone.xml:
<subsystem xmlns="urn:jboss:domain:logging:1.5">
...
<periodic-rotating-file-handler name="FILE" autoflush="true">
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
...
<root-logger>
<level name="ALL"/>
<handlers>
<handler name="FILE"/>
</handlers>
</root-logger>
<formatter name="PATTERN">
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %1.1p [%c] (%t) %s%E%n"/>
</formatter>
</subsystem>