简体   繁体   中英

Jboss EAP 6.2 log4j.properties not logging output but creating log-file

Please help, as default our logs goes to server.log. however, I wanted to create a specific log for my application, when adding log4j.properties it only creates a log file (test/app.log) but not produces any output.

see log4j.properties below:

# LOG4J daily rolling log files configuration
log4j.rootLogger=DEBUG, RollingAppender
log4j.appender.RollingAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RollingAppender.File=../test/app.log
log4j.appender.RollingAppender.DatePattern='.'yyyy-MM-dd
log4j.appender.RollingAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.RollingAppender.layout.ConversionPattern=%d{MM/dd/yyyy HH:mm:ss} %t_%p  %C (%F:%L) - %m%n

my dependencies

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
    </dependency>

I have also tried adding jboss.as.logging.per-deployment=false in Jboss system properties.

Thanks

Can you try adding this dependency as well

<dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM