From spring's code (org.springframework.web.servlet.handler.AbstractHandlerMethodMapping):
this.handlerMethods.put(mapping, newHandlerMethod);
if (logger.isInfoEnabled()) {
logger.info("Mapped \"" + mapping + "\" onto " + newHandlerMethod);
}
As you see the code is already there and mapped at INFO level (apache-commons-logging), so you should see every @RequestMapping by default, no matter if they are in @Controller or @RestController.
⚠ Because you ask for it, first make sure that a logger-implementation is available. If you see
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
At application start there is no logger-implementation! If this message occour, you have to decide what logger-implementation you like to use. The commonly most used are slf4j, log4j and jul.
Slf4j / Maven
Add this to the dependencies to see your output.
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version> </dependency>
Why not use commons-logging?
Simply its a api to be used by others, not an implementation, not a single System.out is made by commons-logging.