it.openutils.log4j
Class Log4jConfigurationServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
it.openutils.log4j.Log4jConfigurationServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public class Log4jConfigurationServlet
- extends javax.servlet.http.HttpServlet
A servlet used to dynamically adjust package logging levels while an application is running. NOTE: This servlet is
only aware of pre-configured packages and packages that contain objects that have logged at least one message since
application startup.
web.xml configuration:
<servlet>
<servlet-name>log4j</servlet-name>
<display-name>Log4j configuration Servlet</display-name>
<servlet-class>it.openutils.log4j.Log4jConfigurationServlet</servlet-class>
</servlet>
The fragment
parameter can be added if you don't want a full xhtml page in output, but only the
content of the body tag, so that it can be used in portlets or struts tiles.
<servlet>
<servlet-name>log4j</servlet-name>
<display-name>Log4j configuration Servlet</display-name>
<servlet-class>it.openutils.log4j.Log4jConfigurationServlet</servlet-class>
<init-param>
<param-name>fragment</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
- Version:
- $Id$
- Author:
- Luther E. Birdzell [email protected], Yoav Shapira [email protected], Fabrizio Giustina
- See Also:
- Serialized Form
Method Summary |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Print the status of all current Logger s and an option to change their respective logging levels. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Change a Logger 's level, then call doGet to refresh the page. |
void |
init(javax.servlet.ServletConfig config)
|
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Log4jConfigurationServlet
public Log4jConfigurationServlet()
doGet
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
- Print the status of all current
Logger
s and an option to change their respective logging levels.
- Overrides:
doGet
in class javax.servlet.http.HttpServlet
- Parameters:
request
- a HttpServletRequest
valueresponse
- a HttpServletResponse
value
- Throws:
javax.servlet.ServletException
- if an error occurs
java.io.IOException
- if an error occurs
doPost
public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
- Change a
Logger
's level, then call doGet
to refresh the page.
- Overrides:
doPost
in class javax.servlet.http.HttpServlet
- Parameters:
request
- a HttpServletRequest
valueresponse
- a HttpServletResponse
value
- Throws:
javax.servlet.ServletException
- if an error occurs
java.io.IOException
- if an error occurs
init
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
-
- Specified by:
init
in interface javax.servlet.Servlet
- Overrides:
init
in class javax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
Copyright © 2008 Openmind. All Rights Reserved.