Files
spring-boot-rest/log4j/src/main/java/com/baeldung/log4j/Log4jRollingExample.java
Daniele Demichelis b74df6163a 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
2016-12-18 09:36:34 -06:00

19 lines
457 B
Java

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