An open API service indexing awesome lists of open source software.

https://github.com/anicetkeric/log4j_sample

Apache Log4j2 with Spring Boot
https://github.com/anicetkeric/log4j_sample

log4j2 log4j2-appender logging

Last synced: 2 months ago
JSON representation

Apache Log4j2 with Spring Boot

Awesome Lists containing this project

README

          

# log4j_sample
Apache Log4j2 with Spring Boot

# Apache Log4j 2
Apache Log4j 2 est une mise à niveau vers Log4j qui fournit des améliorations significatives par rapport à son prédécesseur, Log4j 1.x, et fournit plusieurs améliorations disponibles dans Logback tout en réparant certains problèmes inhérents à l'architecture de Logback. [ Read more ](https://logging.apache.org/log4j/2.0/index.html).

# Log4J 2 Spring Boot Dependencies

Exclude logback from default log dependency of Spring Boot
```xml

org.springframework.boot
spring-boot-starter


org.springframework.boot
spring-boot-starter-logging

```
– Add Log4j2 dependency

```xml

org.springframework.boot
spring-boot-starter-log4j2

```
# Configure Log4j2.xml
```xml


logs





[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
>





[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n






[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
















```
- You can use log4js2 with:

1. Log4J 2 Configuration: Using Properties File

2. Log4J 2 Configuration: Using XML

3. Log4J 2 Configuration: Using JSON

4. Log4J 2 Configuration: Using YAML