Questions tagged [spring-logback]

288 questions
3
votes
2 answers

Logback upgrade from 1.1.11 to 1.3.0-alpha4 in Spring boot-1.5.8 application

Spring boot 1.5.8 by default providing logback-1.1.11 version. I am trying to upgrade the logback version from 1.1.11 to 1.3.0-alpha4 and added the below two properties in…
3
votes
1 answer

Java based Logback Configuration

I got stuck with java based logback configuration via beans. As observed, the configuration is not even loading. Would be great if anybody can guide me to make it resolved. Attaching the code below. public class…
3
votes
0 answers

Spring boot: logging properties

I am using spring boot and as per spring documentation, we can define log file max size and log file max history by declaring below 2 properties in application.properties file. logging.file.max-size…
user1270392
  • 2,981
  • 4
  • 21
  • 25
3
votes
3 answers

spring-boot creates logging.path_IS_UNDEFINED.log file

my spring-boot application creates a log file with name logging.path_IS_UNDEFINEDlogging.file_IS_UNDEFINED.log which clearly states that logging.path and logging.file properties are not set while logback is initializing log configuration. This…
quartaela
  • 2,579
  • 16
  • 63
  • 99
3
votes
1 answer

logback.xml to logback property file

I have a logback.xml file which configures how the logging should be done in my spring boot application. I want to change it to a .properties file. But I am unable to find any documentation.
Naanavanalla
  • 1,412
  • 2
  • 27
  • 52
3
votes
0 answers

How to set environment variable for logback custom property in JUnit test?

In my application, JUnit test case is written with the help of spring configuration. I have Recently added some custom properties in my logback.xml file to store system logs with the help of SyslogAppneder as, logback.xml (snippet)
napster
  • 384
  • 3
  • 13
2
votes
0 answers

Gradle logging on the console after test

We have Spring Boot 2 application and are moving from Log4j to Logback. The whole thing went pretty smooth, but we're running in a small issue now. When doing a gradle build with tests, just before the tests step/lifecycle changes to SUCCEEDED,…
bvanseg
  • 63
  • 3
2
votes
2 answers

"java.lang.IllegalStateException: Could not initialize Logback logging from classpath:logback-spring.xml" in logback-spring.xml level configuration

I have added logback-spring.xml into the class path and it was working fine until I added below dependencies for some ISO message conversion.(crimson dependency is hardcoded in the JPOS library, so it cannot be…
chanuka
  • 39
  • 1
  • 6
2
votes
1 answer

Attach logged user when printing any error

I have a SpringBoot backend with logback configured. Authentication is achieved using a OncePerRequestFilter and setting the authentication in the SecurityContextHolder context. My goal is to print the loggedUser username whenever logback prints an…
2
votes
0 answers

How can I override configuration in logback-spring.xml with properties in Spring's own application.properties?

In my Spring Boot project, I initially set up the logging configuration in the application.properties,…
maxxyme
  • 2,164
  • 5
  • 31
  • 48
2
votes
0 answers

How to force logback to flush logs from a single logger tied to AsyncAppender

In SpringBoot, I am using Logback's AsyncAppender to output logs asynchronously. I would like to know how to force a flush from a single logger that tied to AsyncAppender. I know that I can flush all the loggers with the following…
skmq0106
  • 31
  • 1
2
votes
1 answer

Logging system failed to initialize using configuration from 'null' java.lang.IllegalStateException: Logback configuration error detected:

I want to use a common xml in my logback-spring.xml? how to include the xml in logback-spring.xml without getting an error. I got that to include an xml in our logback-spring.xml we need to use but somehow this is not working for me. I have…
2
votes
0 answers

Logback-spring.xml unable to squash multiline stack trace to single line

I tried multiple solutions on SO, but none of them seem to be working for me. I am fairly new to Logback too, probably why I'm unable to find the right approach for my usecase. Basically, we push logs to a centrally managed log service where we are…
Vishakha Lall
  • 1,178
  • 12
  • 33
2
votes
1 answer

Spring boot: CONSOLE_LOG_PATTERN_IS_UNDEFINED printed when using the logback-spring.xml from Spring documentation

When using the logback configuration in the Spring Boot documentation by putting it in a logback-spring.xml the following is printed out in the console: CONSOLE_LOG_PATTERN_IS_UNDEFINED…
chubbsondubs
  • 37,646
  • 24
  • 106
  • 138
2
votes
0 answers

Logback, Spring Boot - Remapping a log level for external libraries

Sometimes I've got third party libraries logging entries at incorrect levels. I'd like to be able to correct this. I know I can do something along the lines of this
Ren
  • 3,395
  • 2
  • 27
  • 46
1 2
3
19 20