BAEL-1783 (#4545)
* 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:
committed by
KevinGilmore
parent
0fd7481bb9
commit
6656f45f0d
@@ -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...";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user