Questions tagged [logback-classic]
119 questions
1
vote
1 answer
Build-Jdk-Spec version in Manifest.Mf
I am using logback-classic 1.3.5 in my project but it is giving me UnsupportedOperationException. My project is on JDK 8 and when I saw in manifest file of logback-classic-1.3.5, it shows build-jdk-spec version as 19. I just want to know what…

Saurabh Kulkarni
- 11
- 2
1
vote
0 answers
Spring Boot Logging to Database using Logback (Spring Boot 2.3.7)
I am trying to create DB logging appender, ch.qos.logback.classic.db.DBAppender this one to be exact. But from what I read, the DB Appender functionality was dropped from Logback some time ago, with no guarantee when it will be…

hell_storm2004
- 1,401
- 2
- 33
- 66
1
vote
1 answer
Correct way to set log level for azure functions java logback
I am using Consumption plan hosted Azure Functions (Java) with below settings in host.json -
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)",
…

Jacob
- 426
- 3
- 19
1
vote
1 answer
Custom Logback Appender not activated
Java 11 and logback-classic-1.2.11 here. I'm trying to write my own custom appender and am following this Baeldung article to test it out.
My src/main/java/myapp/logging/CatAppender appender (on the runtime classpath):
public class CatAppender…

hotmeatballsoup
- 385
- 6
- 58
- 136
1
vote
0 answers
Logs not printed in Logback- Java Web App
I have a Java web app which runs on Tomcat 9, I am testing it on Unix machine.
I am migrating from log4j to logback, but when I run app on Tomcat, I can't see logs appended in proper file.
Those are Maven dependencies
…

Szanownego
- 239
- 1
- 11
1
vote
0 answers
Duplicate query logs with Spring Data MongoDB
My application.yml:
logging:
level:
org.springframework.data.mongodb.core.MongoTemplate: DEBUG
And in logs I see two records lilke this:
2021-10-27 12:06:14.014 DEBUG 30540 --- [nio-8080-exec-3] o.s.data.mongodb.core.MongoTemplate :…

Victor Levin
- 238
- 2
- 7
1
vote
3 answers
Is there a way to change the level of a log based on it's content?
I'm using Logback for logging, and in several places of my code, I have things like:
if(message.contains("kitten")) {
logger.info(message);
} else if (message.contains("wolf")) {
logger.error(message);
} else…

Fabien G.
- 21
- 4
1
vote
0 answers
How can I add or remove a logger in logback configuration using logback API
The purpose is to enable dynamic re-loading of configuration. I know that changing levels is possible.
But, I could not find any method here LoggerContext for adding or removing loggers.
For example, in the following logback config file, if I want…

Prateek Khatri
- 21
- 1
1
vote
1 answer
Is there a way to specify custom converter inside logback.xml without creating Java class?
I need to replace standard logback stacktrace output with org.apache.commons.lang.exception.ExceptionUtils#getStackTrace() output. I read about converters, but I want to do the same without writing java class, just by editing logback.xml. Is there…

danila_slynko
- 11
- 3
1
vote
1 answer
How does logback- daemon threads get created automatically?
I am trying to understand logback a little more, and I wrote a very simple standalone Java application - hello world:
package com.example;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import…

CuriousMind
- 8,301
- 22
- 65
- 134
1
vote
0 answers
How to print http status in logs with springboot logback
I am trying to print http status code in the log statement using spring boot log. But I do not know the pattern to print that. I used statusCode, status etc but doesnt work. Pls advise is there a way I can have status also printed in the logs for…

Monish Das
- 383
- 2
- 12
- 28
1
vote
0 answers
How to share same file for different appender in logback configuration
I am using different appender in logback-spring.xml, This is my configuration,
Here I am having unique file name and fileNamePattern for each appender so this is working fine but creating each new file for each appender.
Appender 1:

KSK
- 636
- 1
- 9
- 29
1
vote
0 answers
Logback-classic conflict with SLF4J through different dependencies
I have an internal library that was upgrade to use logstash which has a mandatory dependency to logback, hence logback-classic (which has its own slf4j appender internally of its packages, which means I can't exclude any library here).
When I try to…

irobson
- 825
- 8
- 20
1
vote
0 answers
logback.xml is not creating log file while running jar file
I have a java project with this logback. when i running on eclips its normaly create log file but when i export to jar and running jar file it doesn't create log file.

Fathur Rachman
- 11
- 2
1
vote
1 answer
The best practise for logging large messages
we need log a large messages which we receive as response from external services.
This response can be a bigger json or xml, which can has up to 50 mb.
what is the best practise for that? Can we log simple like logger.info(payload)?
Thank you for…

Denis Stephanov
- 4,563
- 24
- 78
- 174