3,699 questions
0
votes
0
answers
73
views
Specific configuration for logging while using Slf4j
Is there a way to have a custom configuration when using Slf4j without the need to create a custom logger?
Let's say I have a controller, service, or any format of a class, I am using SLF4J for ...
0
votes
0
answers
73
views
Spring Boot Logback Configuration: Console Logs Fully but Files Log Only Partially
I have a Spring Boot application with the following logback-spring.xml configuration. After startup, I notice that file logs (info.log and log.log) contain only minimal output, while the console ...
3
votes
0
answers
172
views
Load loki url from yaml
I have my logback-spring.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProperty scope="context" name="...
0
votes
2
answers
341
views
Application still prints Logback logs instead of Log4j2 after migration
I migrated my Spring Boot application from Logback to Log4j2, but the application is still printing logs using Logback.
What I did so far:
Added Log4j2 dependencies:
org.springframework.boot
...
0
votes
0
answers
43
views
How to use log4j binding in cassandra 5.0
I had been using log4j binding in cassandra version 4. But this isn't working in cassandra 5.0. Getting this exception on startup.
org/apache/cassandra/utils/vint/VIntCoding.writeVInt32(ILorg/apache/...
0
votes
1
answer
138
views
How to strip lnav lines from details?
I'm logging with a Ktor server / logback config:
<configuration>
<conversionRule conversionWord="emoji"
converterClass="foo.EmojiLevelConverter" />
<...
3
votes
0
answers
113
views
How to set different log level for different appenders without filters in logback-spring.xml file?
In Spring Boot application for logs made with Slf4j I want to show INFO level logs in console and DEBUG level logs in file. I also want to change level logs in console with Actuator, so I can't use ...
0
votes
1
answer
35
views
Config custom Appender with android.content.Context parameter in constructor
How can I configure a custom Appender with android.content.Context parameter in the constructor like CustomAppender(android.content.Context context) in logback.xml, and how can I pass the Context ...
0
votes
1
answer
71
views
How to log to separate ALL and INFO KTOR level files?
I basically would like to have one file using
install(Logging) {
level = LogLevel.ALL
}
And another using
install(Logging) {
level = LogLevel.INFO
}
(everything else stays equal)
My attempts:...
0
votes
0
answers
73
views
How to Customize Apache NiFi 2.4.0 API Logging to Include Custom Attributes?
I'm using Apache NiFi 2.4.0 and want to extend the default HTTP request logging (nifi-request.log) to include a custom attribute called logType with values like DATA_ACCESS, DATA_EXPORT, or ...
1
vote
1
answer
472
views
How to mask sensitive values (e.g., passwords, API keys) in structured logs in Spring Boot 3.4?
I’m using Spring Boot 3.4 with structured logging (via JsonWriterStructuredLogFormatter), and I want to mask sensitive data such as passwords, API keys, and tokens from the message field in the logs.
...
1
vote
0
answers
48
views
Enabeling per-request DEBUG level in Springf framework
My goal is to have per-request DEBUG level, I can set log level for rootLogger or any specific package (eg, com.example, org.springframework.web ...) to any level, through logback.xml or application....
0
votes
1
answer
260
views
logback error:java.lang.IllegalStateException: Could not initialize Logback logging from classpath:logback-spring.xml
The following is my logback-spring.xml configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<springProperty scop=&...
0
votes
0
answers
62
views
Tomcat + PSI Probe: Increasing logback-x Threads Causing Memory Leak Warning
PSI Probe creates new logback-x threads on each Threads tab access
We have installed PSI Probe on a Tomcat server to monitor deployed applications. However, we’re encountering a recurring issue ...
5
votes
1
answer
246
views
Is it possible to route Logback logging to SLF4J in a Log4j2-based project
My project uses SLF4J with Log4j2, but recently I introduced a dependency that uses Logback for logging and DOES NOT use SLF4J. The dependency's code includes the following import:
import ch.qos....
0
votes
0
answers
94
views
logback auto-reload in spring environment after changing logback.xml stops file logging
When changing this logback.xml in spring boot 3 app the logging to files is stopped. For example if I change root level from INFO to TRACE. After change I can see in the stdout that logback has ...
0
votes
1
answer
68
views
Weird logging behavior for spring security logging on container environment
We have an application using spring security, we need to enable debug logging due to a issue at customer site. The application is a war file deployed in tomcat, hosted in K8s on a container.
We set up ...
0
votes
0
answers
41
views
How to print logback version 1.2.9
When I use Spring Boot 2.1.14 and logback 1.2.9, I want logback version displayed on console, but it is null.
This is my code
Method 1
loggercontext.getProperty(logback.version)
Method 2
On ...
0
votes
0
answers
188
views
GraalVM Native Image: SLF4J, Logback, Netty, InetAddress & Initialization Errors Despite Proper Configuration
I'm encountering an error while building a GraalVM native image for a Spring Boot application in a multi-module setup. The error indicates that an object of type org.slf4j.helpers....
-1
votes
1
answer
145
views
Logback rolling based on file size not working
I use logback-classic in version 1.5.18 with slf4j 2.0.16
Here i have done a basic name for reproducing the issue (rolling doesn't work)
public class LogRotationTest {
public static void main(...
1
vote
1
answer
189
views
delay in receiving loki logs from spring application
I created a simple spring boot application and added a loki4j dependency to it to send logs to loki. Logs are displayed in loki, but this happens with a significant delay (on average 30 seconds). ...
0
votes
1
answer
109
views
Multiple logs merge into one "mega-log" in CloudWatch
I have a SpringBoot service running in ECS with the awslogs driver. It is a pretty standard REST API. For each incoming request, it produces one log with some proprietary info about the request.
...
0
votes
0
answers
79
views
Spring Boot not starting up with lokiLogAppende when Loki is down
I am new to Loki and I am playing with a simple Spring Boot project and a docker-compose file, see here
https://gitlab.com/kicktipp/lokilogging/
Everything works fine so far.
But of course things fail,...
0
votes
1
answer
112
views
Custom log message with additional custom fields in logback console appender in json format
I have this appender
<appender name="CONSOLE_JSON" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder"&...
0
votes
1
answer
129
views
Force Jetty Maven Plugin to use SLF4J instead of JUL for Jetty's logs?
Using Maven 3:
jetty maven plugin - version 11.0.24,
logback classic - version 1.4.14,
jul-to-slf4j version 2.0.16 :
public class MyLifecycleListener implements ServletContextListener {
@Override
...
1
vote
2
answers
505
views
Logging to the console can be slow [closed]
Google has some recommendations about logging in their blog page here:
Logging recommendations for containerized applications
Before we dive into some typical use cases for logging in GKE, let's ...
1
vote
2
answers
67
views
Logback creates new file log for every @Scheduled call
I am trying to create a logging file for my Spring scheduler app, but logback keeps creating a new file every time the scheduler starts.
I want a single file from the time when the scheduler starts to ...
1
vote
1
answer
59
views
logback not working the same throughout the project
Full project on Github (check no-logs branch): https://github.com/BenVella/backend-java/tree/no-logs
Problem: Running in docker-compose for rabbitmq and postgres. I'm not getting logs showing up for ...
0
votes
1
answer
100
views
Configure Logback to write each log level to a separate file
I'm developing a desktop application with Kotlin and when configuring the log I'm not able to write each log level in a different file.
In the file build.gradle.kts I have added the dependencies:
...
3
votes
2
answers
1k
views
How to support structured logging with LogBack?
When I set the following property, as described in Structured logging in Spring Boot 3.4, it works.
logging:
structured:
format:
console: ecs
{
"@timestamp":"2025-02-...
0
votes
0
answers
114
views
Slf4j with Logback breaks when moving from Groovy 2.5.23 to Groovy 4.0.25
I have the following Logging.groovy
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback....
2
votes
0
answers
520
views
OpenTelemetry Logs in New Relic Missing Stack Traces and Have a Different Structure than Local Logs
I recently switched from using New Relic’s Java agent to OpenTelemetry (opentelemetry-javaagent.jar) to avoid vendor lock-in. In theory, OpenTelemetry should make it easier to migrate to another ...
1
vote
0
answers
271
views
How to integrate Logback with Keycloak SPI to log specific events using SLF4J markers?
I am developing a Keycloak SPI (Service Provider Interface) and need to log specific events to a different file using SLF4J markers. However, I am facing issues integrating Logback with Keycloak's ...
0
votes
0
answers
115
views
Logback is not filtering log levels to the Console output as expected
The goal is:
Write only desired log level to the Console output by JVM args (-Dlog.level=DEBUG) (default INFO). (Not working)
Write DEBUG level to ROLLING_FILE_DEBUG file appender. (Working fine)
...
1
vote
1
answer
182
views
How to upper case custom field in logback
I am using logback with spring boot and I want to upper case a custom field that I get from spring property,
<springProperty name="foo" source="app.foo"/>
<...
0
votes
0
answers
98
views
OutOfMemory due to huge logging message in logback triggered by hibernate bean validation
I got an OOM and watched into the heapdump with MAT for my java spring boot application.
I found big threads consuming 250 MB due to holding a too big ch.qos.logback.classic.spi.LoggingEvent
Class ...
0
votes
1
answer
270
views
How to add a formatted_message field on save log in Elasticsearch?
I have an application in Java, Spring Boot and Logback, in the Logback file, as we can see below, part of OpenTelemetry is configured, I receive my logs in the OpenTelemetry collector and then export ...
0
votes
0
answers
139
views
logback error : no applicable action for [Loggers]
we have spring-boot Java based application. we are trying to integrate LOKI with application to have the logs in Grafana dashboard. getting below exception
root@CSX-:/mnt/c/Automation/oe-platform/...
0
votes
1
answer
267
views
CLASS_NOT_FOUND issue with Loki4jAppender
We are using Loki4jAppender to log the streams in spring boot java application
After resolving all dependency issue in maven POM.xml, getting below error
root@CSX-:/mnt/c/Automation/oe-platform/...
0
votes
1
answer
405
views
Compatibility issue in Loki4jAppender for springboot java application
I'm new to Java and trying to set up Logback with a Spring Boot Java app.
Getting this exception while using logback.xml with the Spring Boot Java application:
Correct the classpath of your ...
6
votes
5
answers
11k
views
Error after updating logback to version ^1.5.13
I recently update logback-classic and logback-core from version 1.5.8 to version 1.5.15 in order to fix some vulnerabilities. However, after doing that I couldn't start the application and I got the ...
3
votes
0
answers
241
views
ShortenedThrowableConverter in Spring Boot 3.4 structured logging
In Spring Boot 3.4, structured logging was introduced as a built-in feature. Is it possible to reduce the line length when using this feature with Logstash, especially for exceptions?
For example, ...
0
votes
1
answer
463
views
Problem Launching App After Upgrading from Spring Boot 2.7 to Spring Boot 3.2.11
I am having trouble upgrading a repository from spring 2.7 to 3.X My app builds fine but when I go to launch it I get the same error message every time. I have tried adding, removing, updating various ...
1
vote
1
answer
155
views
SLF4J doesn't find provider from logback-classic on vertx
I'm trying to add Logback on a Vertx project, but it seems SLF4J can't see logback even if itself come from a logback dependency. I used maven dependency logback-classic, which transitively imports ...
1
vote
0
answers
403
views
Any alternative in Logback to MDC to allow custom fields?
I have a log format where I would like to add an attribute with a code to represent that event - I only know the code before all operations. The example output could be:
{ "@timestamp": &...
1
vote
1
answer
420
views
Logback - Proper way to create custom json with string logs and application logs
I am trying to create a custom log format because my app was running into Wildfly and I have migrated it to SpringBoot. On Wildfly the application log was already in a JSON format but If I use a ...
0
votes
0
answers
89
views
Disable Spring JPA Logback DEBUG messages for JpaTransactionManager and AbstractPlatformTransactionManager
If there's a custom Transaction Manager extending JpaTransactionManager, it seems impossible to suppress the DEBUG messages from these two classes.
**org.springframework.transaction.support....
0
votes
1
answer
107
views
Setting logback filter generates exception
I've been trying to set an logback filter in my Eclipse Equinox RT application as follows:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<configuration ...
3
votes
1
answer
176
views
logback - show only errors in catalina.out
I have this file logback-spring.xml:
<configuration>
<property name="DEV_HOME" value="./logs" />
<appender name="FILE-AUDIT" class="ch.qos....
1
vote
1
answer
819
views
Verbose Logback logging
We have updated one of our services to the latest spring version. Since then we have the following verbose logging
09:30:10,622 |-INFO in ch.qos.logback.classic.util.ContextInitializer@62fe6067 - Here ...