Browse Source
Changed over to logback from log4j. Added new minimum logging configurations. Remove log4j configurations and references.
master
Changed over to logback from log4j. Added new minimum logging configurations. Remove log4j configurations and references.
master
Drew Short
11 years ago
7 changed files with 224 additions and 110 deletions
-
21pom.xml
-
34src/includes/log4j.properties
-
73src/includes/logback.xml
-
97src/main/java/com/sothr/imagetools/AppConfig.java
-
23src/main/resources/logback-minimum-config.xml
-
23src/main/scala/com/sothr/imagetools/image/ImageService.scala
-
59src/test/resources/logback-minimum-config.xml
@ -1,34 +0,0 @@ |
|||||
log4j.rootLogger=DEBUG, C, DL, IL, EL |
|
||||
|
|
||||
# Console Output |
|
||||
log4j.appender.C=org.apache.log4j.ConsoleAppender |
|
||||
log4j.appender.C.Threshold=INFO |
|
||||
log4j.appender.C.layout=org.apache.log4j.EnhancedPatternLayout |
|
||||
log4j.appender.C.layout.ConversionPattern=%d{yy-MM-dd HH:mm:ss} %-5p [%c{3.}] - %m%n |
|
||||
|
|
||||
# Debug Rolling Log |
|
||||
log4j.appender.DL=org.apache.log4j.RollingFileAppender |
|
||||
log4j.appender.DL.Threshold=DEBUG |
|
||||
log4j.appender.DL.File=Image-Tools.debug |
|
||||
log4j.appender.DL.MaxFileSize=500KB |
|
||||
log4j.appender.DL.MaxBackupIndex=1 |
|
||||
log4j.appender.DL.layout=org.apache.log4j.EnhancedPatternLayout |
|
||||
log4j.appender.DL.layout.ConversionPattern=%d{yy-MM-dd HH:mm:ss} %-5p [%c{3.}] - %m%n |
|
||||
|
|
||||
# Info Rolling Log |
|
||||
log4j.appender.IL=org.apache.log4j.RollingFileAppender |
|
||||
log4j.appender.IL.Threshold=INFO |
|
||||
log4j.appender.IL.File=Image-Tools.info |
|
||||
log4j.appender.IL.MaxFileSize=100KB |
|
||||
log4j.appender.IL.MaxBackupIndex=1 |
|
||||
log4j.appender.IL.layout=org.apache.log4j.EnhancedPatternLayout |
|
||||
log4j.appender.IL.layout.ConversionPattern=%d{yy-MM-dd HH:mm:ss} %-5p [%c{3.}] - %m%n |
|
||||
|
|
||||
# Error Rolling Log |
|
||||
log4j.appender.EL=org.apache.log4j.RollingFileAppender |
|
||||
log4j.appender.EL.Threshold=ERROR |
|
||||
log4j.appender.EL.File=Image-Tools.err |
|
||||
log4j.appender.EL.MaxFileSize=100KB |
|
||||
log4j.appender.EL.MaxBackupIndex=1 |
|
||||
log4j.appender.EL.layout=org.apache.log4j.EnhancedPatternLayout |
|
||||
log4j.appender.EL.layout.ConversionPattern=%d{yy-MM-dd HH:mm:ss} %-5p [%c{3.}] - %m%n |
|
@ -0,0 +1,73 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<configuration> |
||||
|
<appender name="C" class="ch.qos.logback.core.ConsoleAppender"> |
||||
|
<encoder> |
||||
|
<!-- Sorry Windows Users --> |
||||
|
<withJansi>false</withJansi> |
||||
|
<pattern>[%-5level [%c{16}] - %message%n</pattern> |
||||
|
</encoder> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>INFO</level> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
<appender name="DL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender--> |
||||
|
<File>ImageTools.debug</File> |
||||
|
<encoder> |
||||
|
<withJansi>false</withJansi> |
||||
|
<pattern>[%date{yy-MM-dd HH:mm:ss}] %-5level [%c{16}] - %message%n</pattern> |
||||
|
</encoder> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>DEBUG</level> |
||||
|
</filter> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> |
||||
|
<maxIndex>1</maxIndex> |
||||
|
<FileNamePattern>ImageTools.debug.%i</FileNamePattern> |
||||
|
</rollingPolicy> |
||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
||||
|
<MaxFileSize>5MB</MaxFileSize> |
||||
|
</triggeringPolicy> |
||||
|
</appender> |
||||
|
<appender name="IL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender--> |
||||
|
<File>ImageTools.info</File> |
||||
|
<encoder> |
||||
|
<withJansi>false</withJansi> |
||||
|
<pattern>[%date{yy-MM-dd HH:mm:ss}] %-5level [%c{16}] - %message%n</pattern> |
||||
|
</encoder> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>INFO</level> |
||||
|
</filter> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> |
||||
|
<maxIndex>1</maxIndex> |
||||
|
<FileNamePattern>ImageTools.info.%i</FileNamePattern> |
||||
|
</rollingPolicy> |
||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
||||
|
<MaxFileSize>500KB</MaxFileSize> |
||||
|
</triggeringPolicy> |
||||
|
</appender> |
||||
|
<appender name="EL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender--> |
||||
|
<File>ImageTools.err</File> |
||||
|
<encoder> |
||||
|
<withJansi>false</withJansi> |
||||
|
<pattern>[%.16thread] [%date{yy-MM-dd HH:mm:ss}] %-5level [%c{16}] - %message%n</pattern> |
||||
|
</encoder> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>ERROR</level> |
||||
|
</filter> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> |
||||
|
<maxIndex>1</maxIndex> |
||||
|
<FileNamePattern>ImageTools.err.%i</FileNamePattern> |
||||
|
</rollingPolicy> |
||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
||||
|
<MaxFileSize>500KB</MaxFileSize> |
||||
|
</triggeringPolicy> |
||||
|
</appender> |
||||
|
<root level="DEBUG"> |
||||
|
<appender-ref ref="C"/> |
||||
|
<appender-ref ref="DL"/> |
||||
|
<appender-ref ref="IL"/> |
||||
|
<appender-ref ref="EL"/> |
||||
|
</root> |
||||
|
</configuration> |
@ -0,0 +1,23 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<configuration> |
||||
|
<appender name="EL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<File>ImageTools.err</File> |
||||
|
<encoder> |
||||
|
<withJansi>false</withJansi> |
||||
|
<pattern>[%date{HH:mm:ss}] %-5level [%c{16}] - %message%n</pattern> |
||||
|
</encoder> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>ERROR</level> |
||||
|
</filter> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> |
||||
|
<maxIndex>5</maxIndex> |
||||
|
<FileNamePattern>ImageTools.err.%i</FileNamePattern> |
||||
|
</rollingPolicy> |
||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
||||
|
<MaxFileSize>500KB</MaxFileSize> |
||||
|
</triggeringPolicy> |
||||
|
</appender> |
||||
|
<root level="ERROR"> |
||||
|
<appender-ref ref="EL"/> |
||||
|
</root> |
||||
|
</configuration> |
@ -0,0 +1,59 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<configuration> |
||||
|
<appender name="DL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<File>ImageTools.debug</File> |
||||
|
<encoder> |
||||
|
<withJansi>false</withJansi> |
||||
|
<pattern>[%date{yy-MM-dd HH:mm:ss}] %-5level [%c{16}] - %message%n</pattern> |
||||
|
</encoder> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>DEBUG</level> |
||||
|
</filter> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> |
||||
|
<maxIndex>1</maxIndex> |
||||
|
<FileNamePattern>ImageTools.debug.%i</FileNamePattern> |
||||
|
</rollingPolicy> |
||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
||||
|
<MaxFileSize>5MB</MaxFileSize> |
||||
|
</triggeringPolicy> |
||||
|
</appender> |
||||
|
<appender name="IL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<File>ImageTools.info</File> |
||||
|
<encoder> |
||||
|
<withJansi>false</withJansi> |
||||
|
<pattern>[%date{yy-MM-dd HH:mm:ss}] %-5level [%c{16}] - %message%n</pattern> |
||||
|
</encoder> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>INFO</level> |
||||
|
</filter> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> |
||||
|
<maxIndex>1</maxIndex> |
||||
|
<FileNamePattern>ImageTools.info.%i</FileNamePattern> |
||||
|
</rollingPolicy> |
||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
||||
|
<MaxFileSize>500KB</MaxFileSize> |
||||
|
</triggeringPolicy> |
||||
|
</appender> |
||||
|
<appender name="EL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<File>ImageTools.err</File> |
||||
|
<encoder> |
||||
|
<withJansi>false</withJansi> |
||||
|
<pattern>[%.16thread] [%date{yy-MM-dd HH:mm:ss}] %-5level [%c{16}] - %message%n</pattern> |
||||
|
</encoder> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>ERROR</level> |
||||
|
</filter> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> |
||||
|
<maxIndex>1</maxIndex> |
||||
|
<FileNamePattern>ImageTools.err.%i</FileNamePattern> |
||||
|
</rollingPolicy> |
||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
||||
|
<MaxFileSize>500KB</MaxFileSize> |
||||
|
</triggeringPolicy> |
||||
|
</appender> |
||||
|
<root level="DEBUG"> |
||||
|
<appender-ref ref="DL"/> |
||||
|
<appender-ref ref="IL"/> |
||||
|
<appender-ref ref="EL"/> |
||||
|
</root> |
||||
|
</configuration> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue