testlog.jsp

来自「《精通JSP编程 》源代码(赵强那本) 很有用的源代码」· JSP 代码 · 共 27 行

JSP
27
字号
<%@page import ="org.apache.commons.logging.*"%>
<%
  // 获得Logger实例-helloappLogger
   Log helloappLogger = LogFactory.getLog("helloappLogger");
   out.print(helloappLogger);
  // 获得Logger实例-childLogger
    Log childLogger = LogFactory.getLog("helloappLogger.childLogger");
   
 

    // 通过helloappLogger输出日志信息
    helloappLogger.debug("This is a log message from the helloappLogger" );
    helloappLogger.info("This is a log message from the helloappLogger");
    helloappLogger.warn("This is a log message from the helloappLogger");
    helloappLogger.error("This is a log message from the helloappLogger");
    helloappLogger.fatal("This is a log message from the helloappLogger" );


    // 通过childLogger输出日志信息
    childLogger.debug("This is a log message from the childLogger");
    childLogger.info("This is a log message from the childLogger"); 
    childLogger.warn("This is a log message from the childLogger"); 
    childLogger.error("This is a log message from the childLogger");
    childLogger.fatal("This is a log message from the childLogger");
  
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?