要导入log4j jar包,搂主导了吗没,要可以说声,邮箱留个给我我可以帮你发过去
private Static final Log log=LogFactor.getLog(类.class);
输出日志是就可用
log.debug(" 你想要输出的内容(可以加变量值)");
例子:
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.starting.dao.BorrowDAO;
import com.starting.dao.GoodsDAO;
import com.starting.po.Borrow;
public class Borrowdaoimpl extends HibernateDaoSupport implements BorrowDAO {
private static final Log log=LogFactory.getLog(Borrowdaoimpl.class);
@Override
public void delecBorrow(Borrow e) {
// TODO Auto-generated method stub
log.debug("delectBorrow");
try {
} catch (RuntimeException es) {
// TODO: handle exception
log.debug("delectBorrow fail");
throw es;
}
}