Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
140 additions
and
88 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
logback-classic/src/test/input/joran/issues/logback_1162.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<configuration debug="TRUE"> | ||
<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> | ||
|
||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>${output_dir}/info.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>${output_dir}/info.%d{yyyy-MM-dd}.log.gz</fileNamePattern> | ||
</rollingPolicy> | ||
<encoder> | ||
<pattern>%date %level [%thread] %logger{40} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="DEBUG"> | ||
<appender-ref ref="FILE" /> | ||
</root> | ||
|
||
<shutdownHook/> | ||
</configuration> |
29 changes: 29 additions & 0 deletions
29
logback-classic/src/test/java/ch/qos/logback/classic/issue/logback_1162/Main.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ch.qos.logback.classic.issue.logback_1162; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import ch.qos.logback.classic.ClassicTestConstants; | ||
import ch.qos.logback.classic.LoggerContext; | ||
import ch.qos.logback.classic.joran.JoranConfigurator; | ||
import ch.qos.logback.core.joran.spi.JoranException; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
public class Main { | ||
private static final Logger logger = LoggerFactory.getLogger(Main.class); | ||
|
||
public static void main(String[] args) throws InterruptedException, JoranException { | ||
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); | ||
lc.reset(); | ||
lc.putProperty("output_dir", ClassicTestConstants.OUTPUT_DIR_PREFIX+"logback_issue_1162/"); | ||
|
||
JoranConfigurator configurator = new JoranConfigurator(); | ||
configurator.setContext(lc); | ||
configurator.doConfigure(ClassicTestConstants.JORAN_INPUT_PREFIX+ "issues/logback_1162.xml"); | ||
|
||
|
||
logger.info("Hello, world!"); | ||
|
||
TimeUnit.SECONDS.sleep(0); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
logback-classic/src/test/java/ch/qos/logback/classic/issue/logback_1162/reproduce-bug.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DD="dd" | ||
TOUCH="touch" | ||
|
||
TARGET_DIR=/home/ceki/logback/logback-classic/target/test-output/logback_issue_1162/ | ||
|
||
rm -rf $TARGET_DIR && \ | ||
mkdir -p $TARGET_DIR && \ | ||
$DD if=/dev/urandom of=$TARGET_DIR/info.log bs=1M count=50 && \ | ||
$TOUCH -d "24 hours ago" $TARGET_DIR/info.log | ||
#./gradlew run && \ | ||
#du -hs logs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.