Try this
<%@page import="java.sql.*"%>
<%@page import="java.io.File"%>
<%@ page import="org.apache.commons
<%@ page import="org.apache.commons
<jsp:declaration>
private static final Log logger = LogFactory.getLog("YOU_JSP
</jsp:declaration>
<%! logger.debug("debug: blablabla");
logger.info("info: blablabla");
logger.warn("warn: blablabla");
logger.error("error: blablabla"); %>
In your log4j.properties, look at the comment I added:
log4j.appender.logfi
For example you can do this:
log4j.appender.logfil





by: darkapplePosted on 2008-08-18 at 02:38:36ID: 22250374
I prefer to use Log4j. Though there is built-in SDK Logger system, Log4j is extremely flexible and powerful. Log4j JAR file can be deployed and configured as part of the Web application and does not have to be globally configured like the SDK logger.
/Code/Java /Language- Basics/log 4jAcomplet eexample.h tm
For using Log4j, u need log4j.jar and have to create log4j.properties file.
The log4j.properties should be in classpath.
Here are lots of examples of log4j
http://www.java2s.com
Select allOpen in new window