sandbox-java/rolling-log/src/main/java/de/swingbe/rollinglog/Main.java

21 lines
772 B
Java
Raw Normal View History

2022-01-06 19:03:36 +01:00
package de.swingbe.rollinglog;
2022-01-06 19:53:35 +01:00
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
2022-01-06 19:03:36 +01:00
public class Main {
2022-01-06 19:53:35 +01:00
private static final Logger logger = LoggerFactory.getLogger(Main.class);
2022-01-06 19:03:36 +01:00
public static void main(String[] args) throws InterruptedException {
for (int i = 0; i < 2000; i++) {
2022-01-06 19:53:35 +01:00
logger.trace("TRACE: This is the " + i + ". time I say 'Hello World'.");
logger.info("INFO: This is the " + i + ". time I say 'Hello World'.");
logger.debug("DEBUG: This is the " + i + ". time I say 'Hello World'.");
logger.warn("WARN: This is the " + i + ". time I say 'Hello World'.");
logger.error("ERROR: This is the " + i + ". time I say 'Hello World'.");
Thread.sleep(5);
2022-01-06 19:03:36 +01:00
}
}
}