* BAEL-1783

* tabs to spaces, artifact id renamed

* tabs to spaces

* Added module spring-boot-logging-log4j2

* Removed <name> node

* @GetMapping instead of the older @RequestMapping

* @GetMapping instead of the older @RequestMapping
This commit is contained in:
Andrea Ligios
2018-06-30 04:43:22 +02:00
committed by KevinGilmore
parent 0fd7481bb9
commit 6656f45f0d
8 changed files with 198 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package com.baeldung.springbootmvc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class LoggingController {
Logger logger = LoggerFactory.getLogger(LoggingController.class);
@GetMapping("/")
public String index() {
logger.trace("A TRACE Message");
logger.debug("A DEBUG Message");
logger.info("An INFO Message");
logger.warn("A WARN Message");
logger.error("An ERROR Message");
return "Howdy! Check out the Logs to see the output...";
}
}