📄 servletcontextlog.java
字号:
package com.croftsoft.core.util.log;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import com.croftsoft.core.lang.NullArgumentException;
/*********************************************************************
* Delegates logging to a ServletContext.
*
* @author
* <A HREF="http://www.alumni.caltech.edu/~croft/">David W. Croft</A>
* @version
* 2001-02-27
*********************************************************************/
public final class ServletContextLog implements Log
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
{
private final ServletContext servletContext;
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
public ServletContextLog ( ServletContext servletContext )
//////////////////////////////////////////////////////////////////////
{
NullArgumentException.check (
this.servletContext = servletContext );
}
public ServletContextLog ( Servlet servlet )
//////////////////////////////////////////////////////////////////////
{
this ( servlet.getServletConfig ( ).getServletContext ( ) );
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
public void record ( String message )
//////////////////////////////////////////////////////////////////////
{
servletContext.log ( message );
}
public void record ( Throwable throwable )
//////////////////////////////////////////////////////////////////////
{
servletContext.log ( throwable.getMessage ( ), throwable );
}
public void record ( String message, Throwable throwable )
//////////////////////////////////////////////////////////////////////
{
servletContext.log ( message, throwable );
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -