Logger
Hi,
I have a Spring MVC webapps that needs some server side logging so I configured Log4J in my Spring MVC
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
In my controller, I logged all user transaction.
@Controller
public class MyController {
protected final Log logger = LogFactory.getLog(getClass());
public String setup(){
MyObject object = new MyObject();
logger.info("User check in data...." + object.data);
}
}
I have some questions though:
- Are Logging in a Spring MVC Webapps considered a costly transaction? I mean will this slowdown my app?
- In a production enviroment, will it be OK if I leave out this logger.info? I need to add this for traceability of each transaction and is a requirement but I am worried about the impact of these.
Thanks