Skip to content
Advertisement

Tag: slf4j

Directing logging depending on call context in modular monolith web application

For some story, we used to have an application in microservices architecture, and all services included and used a common dependency library. It was later decided, the microservices approach wasn’t justified and had more overhead than benefit, and eventually was refactored into a modular monolith. Everything is nice and solid, except for one problem. Now everything is being logged into

SLF4J/Java logging: Is it possible to add log arguments automatically?

Introduction We’re using SLF4J in combination with Logback in several Spring (Boot) applications and recently started using the logstash-logback-encoder to implement structured logging. As we also still have to support plain text logs, we wondered whether it was possible to append arguments automatically to log messages without having to add them manually to the message using the {} markers. Example

SLF4J: Class path contains multiple SLF4J bindings warning

I’ve seen in other questions that usually the solution to this warning is to exclude slf4j from the dependency that causes this conflict, but I can’t spot the problem in my project. I run mvn dependency:tree command and this is the output: Answer You can solve the issue by adding the following exclusion in the dependencies (of pom.xml) that caused

Why is Log4j2 not logging inside Spring Boot Application?

I’m trying to use spring boot starter and spring boot starter web. So far I’ve got what I think is a pretty simple set up. I can see that the application is obviously finding and using the log4j2-spring.xml file so my question is why doesn’t anything from the MyRunner class log via log4j2? It does execute and the System.out.println() statements

logging in interface methods

I have been working on java 7 so far and recently moved to java-8, one thing which was surprising is that you can add methods in java-8 interfaces. So far so good….loved this new stuff! Now, my problem is that logging is an essential part of any development but seems lombok.extern.slf4j won’t let you add log stuffs in by interface

Logback conversion rule parametrizing

Is there any way of parametrizing conversion rule in Logback? I’ve tried adding child nodes, additional attributes and I don’t see a way to do it. I would like to add parameter that will be used by LongMessageConverter class. My application is setup on Spring Boot and I am using Sl4J. Answer This is more a question around Logback than

Advertisement