Questions tagged [logback-classic]

119 questions
1
vote
1 answer

How do I supply my own MDCAdapter to slf4j?

I am using slf4j and logback to provide logging services to my set of microservices. I want to ensure that any entries that I add to the MDC always have lower case names, so I'm investigating substituting the LogBackMDCAdapter class with a similar…
DaveH
  • 7,187
  • 5
  • 32
  • 53
1
vote
0 answers

springProfile is not read when loading logback-spring.xml through JoranConfigurator

If I load logback-spring.xml explictly using JoranConfigurator, it is not resolving log.path defined in . I tried by passing log.dir as startup argument as -Dlog.dir=/ff/test/log JoranConfigurator configurator = new JoranConfigurator(); …
Naveen
  • 21
  • 3
1
vote
1 answer

Wildfly 13 - Proper project setup using logback in an ear project

I am deploying my application as an ear archive in wildfly 13. The ear contains a war and an ejb. The ejb is used in different projects. I want to log the information from the war and the ejb into a single file to have the full context what happend…
1
vote
1 answer

Spring Boot 2.0.5 - Activemq 5.14.0 issues with setup logger with gradle

I am getting the following runtime error after adding activemq to my build.gradle. compile("org.apache.activemq:activemq-all:5.14.0") I have tried to exclude modules, but that does not seem exclude the logback like I expected. Please advise on what…
henninb
  • 133
  • 2
  • 11
1
vote
1 answer

slf4j, logback, the target compressed file named exist already

logback 1.1.5 + slf4j 1.7.4. Rollover at midnight 00:00:00,163 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [/opt/wls/appl/log/out.log] to [/opt/wls/appl/log/out.log1294410077875834.tmp] 00:00:00,164 |-INFO in…
OGSL
  • 90
  • 8
1
vote
1 answer

Logback configuration when running in IDE

Are there any cool tricks to have a single logback.xml configuration that changes for PROD vs running in an IDE? I want to use different appenders, patterns and log level based on whether I'm running in my IDE or if it's running in PROD in a jar. I…
Hilikus
  • 9,954
  • 14
  • 65
  • 118
1
vote
0 answers

Generated One extra blank log file For one Application Run

I am Configured Logger For my application And Give the Logfilename as Current Time Stamp So It Expected to create one log File with the name as current Time stamp BuT INSTEDE IT CREATE ONE LOGFILE WITH CURRENT TIMESTAMP AND ANOTHER FILE WHICH IS…
Abhishek
  • 101
  • 3
  • 8
1
vote
1 answer

Logback: SizeAndTimeBasedRollingPolicy deletes all archived files when totalSizeCap reached

I am using SizeAndTimeBasedRollingPolicy in logback. For small values of maxFileSize and totalSizeCap, logback deletes older archived files only, when totalSizeCap limit is reached. But, for large values of totalSizeCap (~ 5GB) , it deletes all…
1
vote
1 answer

Logback missing entries for RollingFileAppender and AysncAppender

Hi I am using logback version 1.1.10 and my configuration is as below: I am facing a big issue while logging events and not able to find the required logs.
Ashish Malhotra
  • 241
  • 1
  • 2
  • 14
1
vote
0 answers

Logback programmatic configuration in SpringBoot

I'm trying to configure logback programmatically in Spring Boot. I have a requirement to not use any XML files in my project. I'm using logback-extensions to create my logback appenders, etc. @Configuration public class LoggingConfig { @Bean …
starman1979
  • 974
  • 4
  • 12
  • 33
1
vote
1 answer

BuferredIO and ImmediateFlush properties in Logback configuration

I'm migrating a legacy app to Spring Boot and I've faced with the following problem: when I start the app it fails because of the following exception: Exception in thread "main" java.lang.IllegalStateException: Logback configuration error…
Dmitry Senkovich
  • 5,521
  • 8
  • 37
  • 74
1
vote
1 answer

How to Override method name in Logback logging?

I am trying to implement a logging concept with AOP but while printing the log I need give my own method name instead of the default. Update (based on the comments from @glitch): I am using the %M conversion specifier to tell Logback to include the…
Ashok Kumar N
  • 573
  • 6
  • 23
1
vote
0 answers

Logback ClassCastException for LoggerFactory

I am using below code to change log level at runtime in logback. import org.slf4j.LoggerFactory; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; Logger root =…
Rajesh Kolhapure
  • 741
  • 1
  • 10
  • 21
1
vote
1 answer

Logback file with timestamp in file name not rolledover

I am using below configuration for logs. File is not rolled over when timestamp is included in the file name. Is this because of timeReference used in timestamp? If I remove timestamp from file name then file rolls on reaching 10KB file size. Is…
Rajesh Kolhapure
  • 741
  • 1
  • 10
  • 21
1
vote
1 answer

logback condition not working

I'm trying to define a logback.xml that sets loglevel to INFO in PROD Environment, all other environments to DEBUG. Therefore we have an environment variable ENV, that is set to "PROD" on PROD Environment. My logback.xml looks like this:
peez80
  • 1,583
  • 2
  • 15
  • 32