Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 04:10 AM
Hi Fatma,
thanks a lot for your reply. Unfortunately, I have the same problem as Dom1. The standardout is visible in the output tab of each task, while logging messages are not displayed. I considered all of your solution hints, but the behaviour persists. My minimal example, adapted from above, looks like this. These are the dependencies in the pom.xml (I also tried with slf4j-simple as you suggested):
<dependencies>
<!-- SLF4J API -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>
<!-- Logback Classic (includes SLF4J binding) -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
</dependencies>
And this is the code contained in the jar:
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TestLogging {
private static final Logger logger = LoggerFactory.getLogger(TestLogging.class);
public static void main(String[] args) {
logger.info("This is an INFO message.");
logger.warn("This is a WARN message.");
logger.error("This is an ERROR message.");
}
}
Is it possible that it is an issue with log4j 2? I have version 2.20 installed. Help would be much appreciated as the missing logs make debugging very cumbersome.
Thanks a lot!