Pull Request for "A Guide to Rolling File Appenders" article. (#876)

* First test with log4j rolling appenders

* small fix

* Log4j rolling appender

* First set up with rolling file on log4j 2

* Added logback code.

* log4j2 more detailed example

* log4j2 more detailed example

* Improved names and examples

* Fixed configurations

* improved configs

* formatted

* Final fix

* fixed formatting

* Formatting fix

* Fix sample apps to avoid try / catch

* Fix request to replace files

* Fix end lines
This commit is contained in:
Daniele Demichelis
2016-12-18 16:36:34 +01:00
committed by KevinGilmore
parent bfb062d57f
commit b74df6163a
8 changed files with 279 additions and 15 deletions

View File

@@ -0,0 +1,19 @@
package com.baeldung.slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.stream.IntStream;
public class Slf4jRollingExample {
private static Logger logger = LoggerFactory.getLogger(Slf4jRollingExample.class);
public static void main(String[] args) throws InterruptedException {
for(int i = 0; i<2000; i++){
logger.info("This is the {} time I say 'Hello World'.", i);
Thread.sleep(100);
}
}
}