Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.1.2
-
JDK 1.8
Logback 1.1.2
Reactor-Logback 1.1.2.RELEASEpom.xml snippets<dependencies> ... <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>2.3.1</version> </dependency> </dependencies> ... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <compilerId>groovy-eclipse-compiler</compilerId> <source>1.8</source> <target>1.8</target> </configuration> <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-eclipse-compiler</artifactId> <version>2.9.0-01</version> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-eclipse-batch</artifactId> <version>2.3.4-01</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-eclipse-compiler</artifactId> <version>2.9.0-01</version> <extensions>true</extensions> </plugin> ... </plugins> </build>
JDK 1.8 Logback 1.1.2 Reactor-Logback 1.1.2.RELEASE pom.xml snippets <dependencies> ... <dependency> <groupId> org.codehaus.groovy </groupId> <artifactId> groovy-all </artifactId> <version> 2.3.1 </version> </dependency> </dependencies> ... <build> <plugins> <plugin> <groupId> org.apache.maven.plugins </groupId> <artifactId> maven-compiler-plugin </artifactId> <version> 3.1 </version> <configuration> <compilerId> groovy-eclipse-compiler </compilerId> <source> 1.8 </source> <target> 1.8 </target> </configuration> <dependencies> <dependency> <groupId> org.codehaus.groovy </groupId> <artifactId> groovy-eclipse-compiler </artifactId> <version> 2.9.0-01 </version> </dependency> <dependency> <groupId> org.codehaus.groovy </groupId> <artifactId> groovy-eclipse-batch </artifactId> <version> 2.3.4-01 </version> </dependency> </dependencies> </plugin> <plugin> <groupId> org.codehaus.groovy </groupId> <artifactId> groovy-eclipse-compiler </artifactId> <version> 2.9.0-01 </version> <extensions> true </extensions> </plugin> ... </plugins> </build>
Description
Configuration: logback.groovy
import ch.qos.logback.classic.encoder.PatternLayoutEncoder import ch.qos.logback.core.ConsoleAppender import ch.qos.logback.core.rolling.RollingFileAppender import ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP import ch.qos.logback.core.rolling.TimeBasedRollingPolicy import reactor.logback.AsyncAppender import static ch.qos.logback.classic.Level.DEBUG import static ch.qos.logback.classic.Level.INFO appender("fileAppender", RollingFileAppender) { file = "/var/log/tomcat/project.log" rollingPolicy(TimeBasedRollingPolicy) { fileNamePattern = "/var/log/tomcat/project-%d{yyyy-MM-dd}.%i.log" timeBasedFileNamingAndTriggeringPolicy(SizeAndTimeBasedFNATP) { maxFileSize = "50MB" } } encoder(PatternLayoutEncoder) { pattern = "%gray(%d{yyyy-MM-dd}) %cyan(%d{HH:mm:ss}).%yellow(%d{SSS}) %highlight(%-5level) %green(%logger{36}) - %msg%n" } } appender("async", AsyncAppender) { appenderRef('fileAppender') } root(INFO, ["async"])
Logs are printed in tomcat server log instead of specified files and also contain error from logback:
log
INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.groovy] at [file:/path/to/project/WEB-INF/classes/logback.groovy] INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79ace34b - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender] INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79ace34b - Naming appender as [fileAppender] INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern /var/log/tomcat/project-%d{yyyy-MM-dd}.%i.log for the active file INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@75b6be5b - The date pattern is 'yyyy-MM-dd' from file name pattern '/var/log/tomcat/project-%d{yyyy-MM-dd}.%i.log'. INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@75b6be5b - Roll-over at midnight. INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@75b6be5b - Setting initial period to Mon Aug 11 10:21:39 UTC 2014 INFO in ch.qos.logback.core.rolling.RollingFileAppender[fileAppender] - Active log file name: /var/log/tomcat/project.log INFO in ch.qos.logback.core.rolling.RollingFileAppender[fileAppender] - File property is set to [/var/log/tomcat/project.log] INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79ace34b - About to instantiate appender of type [reactor.logback.AsyncAppender] INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79ace34b - Naming appender as [async] ERROR in ch.qos.logback.classic.gaffer.AppenderDelegate@605215a4 - Appender [async] of type [reactor.logback.AsyncAppender] has no appplicable [appenderRef] property INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79ace34b - Setting level of logger [ROOT] to INFO INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79ace34b - Attaching appender named [async] to Logger[ROOT]