logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Veit Guna" <Veit.G...@gmx.de>
Subject RollingRandomAccessFile and emtpy log file
Date Wed, 03 Feb 2016 08:47:49 GMT

I'm using log4j 2.5 with the RollingRandomAccessFile. When the application starts up and performs
logging, the logfile
gets created, but nothing is written to it. Only after I stop the application the content
appears. I also doublechecked the 256KB
buffer. But logging 600KB doesn't seem to trigger a write to the file. Console appender is
working fine.

Any idea what I'm missing?

Here's my configuration:

--cut here--
<?xml version="1.0" encoding="UTF-8"?>

        <Property name="logsPath">${sys:app.logs:-${env:APP_LOGS:-logs}}</Property>

        <RollingRandomAccessFile name="rollingFileAppender" fileName="${logsPath}/app.log"
filePattern="${logsPath}/app-%d{yyyy-MM-dd}-%i.log" immediateFlush="false">
                <pattern>%d %-5p [%mdc{RQID}] [%c{1}] - %m%n</pattern>
                <SizeBasedTriggeringPolicy size="10 MB" />
            <DefaultRolloverStrategy max="5" />
        <Console name="consoleAppender" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss,SSS} %-5p [%mdc{RQID}] [%c{1}] - %m%n"

        <Logger name="com.acme.app" level="info" />

        <!-- spring -->
        <Logger name="org.springframework.security" level="info" />
        <Logger name="org.springframework.transaction" level="info" />
        <Logger name="org.springframework.orm.jpa" level="info" />

        <!-- log SQL statements -->
        <Logger name="org.hibernate.SQL" level="error" />
        <!-- log bind parameters -->
        <Logger name="org.hibernate.type" level="error" />

        <Root level="info">
            <AppenderRef ref="consoleAppender" />
            <AppenderRef ref="rollingFileAppender" />

--cut here--

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message