org.abstracthorizon.danube.support.logging.patternsupport
Class CurrentDateTimeProcessor

java.lang.Object
  extended by org.abstracthorizon.danube.support.logging.patternsupport.CurrentDateTimeProcessor
All Implemented Interfaces:
PatternProcessor

public class CurrentDateTimeProcessor
extends Object
implements PatternProcessor

This processor adds %t parameter handling replacing it with the current date and time in Common Log Format (see Apache HTTP server)

Author:
Daniel Sendula

Field Summary
static DateFormat COMMON_LOG_FORMAT
          Common log format
protected  int dateIndex
          Index of date field
static DateFormat DATETIME_LOG_FORMAT
          Common log format
protected  int dateTimeIndex
          Index of date time fields
 
Constructor Summary
CurrentDateTimeProcessor()
          Constructor
 
Method Summary
 int init(int index, StringBuffer message)
          Checks if parameter is present and if so replaces it and caches its index
 void process(Connection connection, Object[] array)
          Adds current time and date in common log format at cached index into the array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMON_LOG_FORMAT

public static final DateFormat COMMON_LOG_FORMAT
Common log format


DATETIME_LOG_FORMAT

public static final DateFormat DATETIME_LOG_FORMAT
Common log format


dateIndex

protected int dateIndex
Index of date field


dateTimeIndex

protected int dateTimeIndex
Index of date time fields

Constructor Detail

CurrentDateTimeProcessor

public CurrentDateTimeProcessor()
Constructor

Method Detail

init

public int init(int index,
                StringBuffer message)
Checks if parameter is present and if so replaces it and caches its index

Specified by:
init in interface PatternProcessor
Parameters:
index - next index to be used
message - message to be altered

process

public void process(Connection connection,
                    Object[] array)
Adds current time and date in common log format at cached index into the array

Specified by:
process in interface PatternProcessor
Parameters:
connection - connection
array - array


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.