JBoss AS 7: Registration

I'm struggling a bit with JBoss AS7 and logging. I can not find anything related on the Internet, despite the fact that my problem is very common.

The default log looks like this:

11:57:29,950 INFO  [stdout] (http--0.0.0.0-8081-78) 248408930 [http--0.0.0.0-8081-78] INFO  org.apache.http.impl.client.DefaultHttpClient  - I/O exception (java.net.SocketException) caught when processing request: Connection reset
11:57:29,950 INFO  [stdout] (http--0.0.0.0-8081-78) 248408930 [http--0.0.0.0-8081-78] INFO org.apache.http.impl.client.DefaultHttpClient  - Retrying request

pay attention to [stdout], those lines that are written to stout by some logging library that is used by some library and received by JBoss and written to the log file. This is what I want to fix.

I suppose there should be a way to have an adapter that tells log4j (or any other logging structure) to log into the jboss logging subsystem?

My first idea was to remove the entire log4j configuration from the class path of my project. I found one in the used library that wrote to stdout. But this does not fix anything.

11:21:01,648 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment).
11:21:01,648 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) log4j:WARN Please initialize the log4j system properly.
11:21:01,648 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

, . , , .

JBoss AS , , ?

, - , !

Malax

+5
1

, , log4j JBoss AS7. , appenders, log4j, , . AS7-514. .

, jboss-deployment-structure.xml, :

<jboss-deployment-structure>
    <deployment>
        <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
        <exclusions>
            <module name="org.apache.log4j" />
        </exclusions>
    </deployment>
</jboss-deployment-structure>

log4j WEB-INF/lib , .

, .

+14

All Articles