Class AccessLogger
java.lang.Object
org.apache.synapse.transport.http.access.AccessLogger
Class that logs the Http Accesses to the access log files. Code segment borrowed from
Apache Tomcat's org.apache.catalina.valves.AccessLogValve with thanks.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected FileThe current log file we are writing to.protected SimpleDateFormatA date formatter to format a Date into a date in the given file formatbooleanEnable logging.static final Stringprotected PrintWriterThe PrintWriter to which we are currently logging, if any. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidChecks whether the supplied Throwable is one that needs to be re-thrown and swallows all others.protected voidinitOpen()voidLog the specified message to the log file, switching files if the date has changed since the previous log call.protected voidopen()Open the new log file for the date specified bydateStamp.
-
Field Details
-
NHTTP_LOG_DIRECTORY
- See Also:
-
ACCESS_LOG_ID
- See Also:
-
fileDateFormatter
A date formatter to format a Date into a date in the given file format -
writer
The PrintWriter to which we are currently logging, if any. -
currentLogFile
The current log file we are writing to. Helpful when checkExists is true. -
isLoggingEnabled
public boolean isLoggingEnabledEnable logging.
-
-
Constructor Details
-
AccessLogger
public AccessLogger(org.apache.commons.logging.Log log)
-
-
Method Details
-
log
Log the specified message to the log file, switching files if the date has changed since the previous log call.- Parameters:
message- Message to be logged
-
initOpen
protected void initOpen() -
open
protected void open()Open the new log file for the date specified bydateStamp. -
handleThrowable
Checks whether the supplied Throwable is one that needs to be re-thrown and swallows all others.- Parameters:
t- the Throwable to check
-