Logs are not displayed in stdout.
I use for logging slf4j and slf4j .
Initially, when the project was not multi-modular, everything worked perfectly. But as soon as I made a maven multi-module project out of it, then all the logs were no longer displayed (except for the standard INFO level).
slf4j and slf4j connected in the parent pom.xml :
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>department-app</groupId> <artifactId>department-app</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <name>department</name> <modules> <module>rest</module> <module>web-app</module> </modules> <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.5.6</version> </dependency> </dependencies> </project> Configure log4j:
log4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n There is also logging in the controller, but it also does not work:
private final Logger logger = LoggerFactory.getLogger(EmployeesController.class); @RequestMapping(value = "/remove/employee/{id}", method = RequestMethod.POST) public List<Employees> deleteEmployeeById(@PathVariable("id") Long id){ employeesService.delete(id); logger.info(id + "deleted successful"); return employeesService.getAll(); }