Questions tagged [spring-logback]
288 questions
4
votes
2 answers
Logback RollingFileAppender FileNotFoundException
I am using logback in my spring-boot project. When we deploy the app in PROD environment, deployment is failed with below exceptions. Before PROD, we deployed the app in lower environments, we did not see any issues. Can someone please throw some…

Naveen
- 907
- 2
- 15
- 25
4
votes
1 answer
ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
I am converting a spring app to spring-boot, using boot-starter-parent version: 2.0.4.RELEASE. When I build using
mvn install, its is going through fine, but when I am trying to run the app using command:mvn spring-boot:run…

Nitin1706
- 621
- 1
- 11
- 21
4
votes
2 answers
Print a specific header in using logback in spring boot
I am using spring-boot and using logback to generate the logs. Now I want to log a specific header in every log.
How can i achieve that.
My logback file is

Ankit Bansal
- 2,162
- 8
- 42
- 79
4
votes
1 answer
Unable to get logback-spring.xml property file using Spring Cloud Config and Discovery
I'm using Discovery first bootstrap feature and Consul as a Discovery Server, url to Config Server is located during start-up and I was able to get application.properties. I need also to get logback-spring.xml configuration from Config server and I…

nmyk
- 1,582
- 1
- 8
- 20
3
votes
2 answers
How to use timestamp in spring boot property file?
I want to use restart timestamp in log file name, can I get it somehow in properties file?
Current implementation:
logging.file.name=abc_services-${PID}.log
Something like below should be…

Vipin
- 4,851
- 3
- 35
- 65
3
votes
0 answers
How to disable ch.qos.logback's own INFO messages in the run of the SpringBootTest during "mvn clean install"
After a discussion with @RasmusFaber, the author of the most upvoted answer to
How to prevent logback from outputting its own status at the start of every log when using a layout, I decided to create a new question as the solution in that question…

Honza Zidek
- 9,204
- 4
- 72
- 118
3
votes
1 answer
Spring boot remove logback appender added in code(auto configuration)
I’d like to have spring auto configuration which adds LogstashTcpSocketAppender.
What I have done:
The LogstashTcpSocketAppender was added in to the LoggerContext from the LogstashAutoConfiguration.java
@Configuration
@ConditionalOnProperty(name =…

wakedeer
- 493
- 5
- 14
3
votes
0 answers
Logback with LoggingEventCompositeJsonEncoder do not log events when throwable object is added
I am working with Spring boot/Spring cloud stream project
I use Logback for logging with ConsoleAppender and LoggingEventCompositeJsonEncoder as encoder
when I am trying to log an error, in case just a message or message with structured arguments is…

Panteleev Dima
- 175
- 2
- 18
3
votes
2 answers
How to customize or remove default attributes in Log4j2 - JSON Layout
In Spring Boot 2 application I have configured Log4j2 with JsonLayout like below
....
…

Ravikumar
- 413
- 1
- 7
- 18
3
votes
2 answers
How to specify default Logback configuration for any spring profile that is not already present in the config
Here is my simplified logback-spring.xml configuration: