* 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
24 lines
664 B
Java
24 lines
664 B
Java
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...";
|
|
}
|
|
}
|