-
I am new to SLF4J. I tried to "separate my concerns" and make this library do the logging in my app (which did the logging on its own). Here's what I tried @Slf4j
public class Measurer {
// ...
log.info(averageMeasurementLog(measuredProcedure));
// ...
private String averageMeasurementLog(MeasuredProcedure measuredProcedure) {
// builds and returns a String
Configuration:
thresholdFilter:
level: info
appenders:
Console:
name: CONSOLE
PatternLayout:
pattern: "%m"
target: SYSTEM_OUT
File:
name: FILE
fileName: "log.txt"
Loggers:
Root:
level: info
AppenderRef:
ref: CONSOLE
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.20.0</version>
</dependency> Unfortunately, I don't see anything in my console output. Why is that? |
Beta Was this translation helpful? Give feedback.
Answered by
xtyuns
Jul 8, 2023
Replies: 1 comment 1 reply
-
in the fact, this is not a problem with <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.15.2</version>
</dependency> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
NadChel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in the fact, this is not a problem with
slf4j
, because you are usinglog4j-slf4j2-impl
, you can read the doc Configuration with YAML. Obviously, you need to add this dependency