1

My dependencies looks like

 <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.13</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.3</version>
        </dependency>
<dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>3.0.14.Final</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client</artifactId>
            <version>3.0.14.Final</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
            <version>2.6.3</version>
        </dependency>

and I use them as

  private static final Logger LOGGER = LoggerFactory.getLogger(StealthWatch.class);

When I run my application on console using maven, I see

129  [main] DEBUG c.e.boeing.internal.StealthWatch - Stealthwatch with url: http://127.0.0.1:8080/stealthwatch/rest/activities, query: <IDSentrieServiceReq><partner_id>StealthWatchPartnerId</partner_id><partner_passcode>StealthWatchPartnerPasscode</partner_passcode><service name="IDSentrieUser" version="1.1"><action id="IPIDActivityGet"><type>delta</type><time_start>2016-01-08T15:28:37.586</time_start><time_end>2016-01-08T15:28:37.642</time_end></action></service></IDSentrieServiceReq>
200  [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
201  [main] DEBUG o.j.resteasy.resteasy_jaxrs.i18n - RESTEASY002330: Unable to retrieve config: expandEntityReferences defaults to false
201  [main] DEBUG o.j.resteasy.resteasy_jaxrs.i18n - RESTEASY002335: Unable to retrieve config: enableSecureProcessingFeature defaults to true
201  [main] DEBUG o.j.resteasy.resteasy_jaxrs.i18n - RESTEASY002325: Unable to retrieve config: disableDTDs defaults to true
205  [main] DEBUG o.j.resteasy.resteasy_jaxrs.i18n - RESTEASY002330: Unable to retrieve config: expandEntityReferences defaults to false
205  [main] DEBUG o.j.resteasy.resteasy_jaxrs.i18n - RESTEASY002335: Unable to retrieve config: enableSecureProcessingFeature defaults to true
205  [main] DEBUG o.j.resteasy.resteasy_jaxrs.i18n - RESTEASY002325: Unable to retrieve config: disableDTDs defaults to true
132  [main] DEBUG c.e.boeing.internal.StealthWatch - Stealthwatch with url: http://127.0.0.1:8080/stealthwatch/rest/activities, query: <IDSentrieServiceReq><partner_id>StealthWatchPartnerId</partner_id><partner_passcode>StealthWatchPartnerPasscode</partner_passcode><service name="IDSentrieUser" version="1.1"><action id="IPIDActivityGet"><type>delta</type><time_start>2016-01-08T15:33:06.022</time_start><time_end>2016-01-08T15:33:06.076</time_end></action></service></IDSentrieServiceReq>

My logback.xml is

<configuration>
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>ec-dhcp.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- daily rollover -->
            <fileNamePattern>ec-dhcp.log.%d{yyyy-MM-dd}.log</fileNamePattern>
            <!-- keep 30 days' worth of history -->
            <maxHistory>30</maxHistory>
        </rollingPolicy>

        <encoder>
            <pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="DEBUG">
        <appender-ref ref="FILE" />
    </root>
</configuration>

How do I get rid of all org.jboss logging?

daydreamer
  • 87,243
  • 191
  • 450
  • 722

1 Answers1

3

Obviously logback is already handling your logging output so all you need is telling logback to leave out the talkative information coming from the org.jboss package.

You do this by adding this to your logback.xml:

<logger name="org.jboss" level="off" />

I wouldn't switch off logging completely because this can introduce hard to find problems. So perhaps even better try info, warn or error first and see if this is "silent" enough. I suggest you have a look at the complete logfile as it is now and detect which packages create the most information. Then configure logback not globally but per package:

<logger name="org.jboss" level="info" />
<logger name="org.jboss.resteasy" level="warn" />

There is plenty information about configuring logback available here on SO, see this for example.

Community
  • 1
  • 1
Marged
  • 10,577
  • 10
  • 57
  • 99