public class LogUtil
extends java.lang.Object
Constructor and Description |
---|
LogUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
initLogging()
Initialize logging for the web application context in which the given
servlet is running.
|
static void |
initLogging(javax.servlet.http.HttpServlet servlet)
Initialize logging for the web application context in which the given
servlet is running.
|
static void |
initLogging(java.lang.String path)
Initialize logging for the web application context in which the given
servlet is running.
|
static void |
logServerAccessEnd(int resCode,
long resSizeInBytes,
java.lang.String logName)
Write log entry to named log.
|
static void |
logServerAccessStart(javax.servlet.http.HttpServletRequest req,
java.lang.String logName,
java.lang.String reqSource,
java.lang.String reqID)
Gather information from the given HttpServletRequest for inclusion in both
regular logging messages and THREDDS access log messages.
|
static void |
logServerShutdown(java.lang.String source)
Gather current thread information for inclusion in regular logging
messages.
|
static void |
logServerStartup(java.lang.String source)
Gather current thread information for inclusion in regular logging
messages.
|
public static void initLogging(javax.servlet.http.HttpServlet servlet)
servlet
- - the servlet.public static void initLogging(java.lang.String path)
path
- - the path to the log4j.xml filepublic static void initLogging()
public static void logServerStartup(java.lang.String source)
source
- The source id of who started the logging. Typically an init()
method.public static void logServerShutdown(java.lang.String source)
source
- The source id of who started the logging. Typically an init()
method.public static void logServerAccessStart(javax.servlet.http.HttpServletRequest req, java.lang.String logName, java.lang.String reqSource, java.lang.String reqID)
req
- the current HttpServletRequest.logName
- Name of Logger to write stuff.public static void logServerAccessEnd(int resCode, long resSizeInBytes, java.lang.String logName)
resCode
- - the result code for this request.resSizeInBytes
- - the number of bytes returned in this result, -1 if unknown.logName
- the name of the Logger to which to write stuff.