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
- Host: GitHub
- URL: https://github.com/anicetkeric/log4j_sample
- Owner: anicetkeric
- Created: 2017-06-05T20:29:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-18T22:17:08.000Z (over 8 years ago)
- Last Synced: 2025-05-21T01:13:22.152Z (5 months ago)
- Topics: log4j2, log4j2-appender, logging
- Language: Shell
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 DependenciesExclude logback from default log dependency of Spring Boot
```xmlorg.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