Merge pull request #8125 from eugenp/revert-8119-BAEL-3275-2

Revert "BAEL-3275: Using blocking queue for pub-sub"
This commit is contained in:
Eric Martin
2019-10-31 20:43:47 -05:00
committed by GitHub
parent db85c8f275
commit 3225470df5
20543 changed files with 1642750 additions and 0 deletions
@@ -0,0 +1,17 @@
package com.baeldung.log4j;
import org.apache.log4j.Logger;
public class Log4jExample {
private final static Logger logger = Logger.getLogger(Log4jExample.class);
public static void main(String[] args) {
logger.trace("Trace log message");
logger.debug("Debug log message");
logger.info("Info log message");
logger.error("Error log message");
}
}
@@ -0,0 +1,18 @@
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);
}
}
}
@@ -0,0 +1,16 @@
package com.baeldung.log4j2;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
public class Log4j2Example {
private static final Logger logger = LogManager.getLogger(Log4j2Example.class);
public static void main(String[] args) {
logger.debug("Debug log message");
logger.info("Info log message");
logger.error("Error log message");
}
}
@@ -0,0 +1,18 @@
package com.baeldung.log4j2;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class Log4j2RollingExample {
private static final Logger logger = LogManager.getLogger(Log4j2RollingExample.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);
}
LogManager.shutdown();
}
}
@@ -0,0 +1,16 @@
package com.baeldung.logback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LogbackExample {
private static final Logger logger = LoggerFactory.getLogger(LogbackExample.class);
public static void main(String[] args) {
logger.debug("Debug log message");
logger.info("Info log message");
logger.error("Error log message");
}
}
@@ -0,0 +1,19 @@
package com.baeldung.logback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.stream.IntStream;
public class LogbackRollingExample {
private static final Logger logger = LoggerFactory.getLogger(LogbackRollingExample.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);
}
}
}
@@ -0,0 +1,16 @@
package com.baeldung.slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SLF4JLogExceptions {
public static void main(String[] args) {
Logger logger = LoggerFactory.getLogger(SLF4JLogExceptions.class);
logger.error("An exception occurred!");
logger.error("An exception occurred!", new Exception("Custom exception"));
logger.error("{}, {}! An exception occurred!", "Hello", "World", new Exception("Custom exception"));
}
}
@@ -0,0 +1,20 @@
package com.baeldung.slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* To switch between logging frameworks you need only to uncomment needed framework dependencies in pom.xml
*/
public class Slf4jExample {
private static Logger logger = LoggerFactory.getLogger(Slf4jExample.class);
public static void main(String[] args) {
logger.debug("Debug log message");
logger.info("Info log message");
logger.error("Error log message");
String variable = "Hello John";
logger.debug("Printing variable value {} ", variable);
}
}
@@ -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);
}
}
}