Bael 6011: Spring Boot Logback and Log4j2 Extensions (#13327)

This commit is contained in:
Hamid Reza Sharifi
2023-01-23 18:14:23 +03:30
committed by GitHub
parent 4b3a693263
commit 8f620b2281
12 changed files with 180 additions and 1 deletions
@@ -0,0 +1,25 @@
package com.baeldung.extensions;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
@PropertySource("classpath:application-log4j2-extensions.properties")
public class SpringBootLog4j2ExtensionsApplication {
private static final Logger logger = LogManager.getLogger(SpringBootLog4j2ExtensionsApplication.class);
public static void main(String[] args) {
SpringApplication.run(SpringBootLog4j2ExtensionsApplication.class, args);
logger.trace("Trace log message");
logger.debug("Debug log message");
logger.info("Info log message");
logger.error("Error log message");
logger.warn("Warn log message");
logger.fatal("Fatal log message");
}
}