Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

270
Vistas
How can I change the log level identifier printed out in JBoss EAP 7 log?

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

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

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>
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda