Permalink
Browse files

[PAXWEB-356]add logDispatch configuration for jetty RequestLogHandler

  • Loading branch information...
1 parent d6277f6 commit 25c684ea59cab4002f8e5a8f10f3ba5587eb8d24 @ffang ffang committed Mar 19, 2012
@@ -87,6 +87,7 @@
static final String PROPERTY_LOG_NCSA_RETAINDAYS = "org.ops4j.pax.web.log.ncsa.retaindays";
static final String PROPERTY_LOG_NCSA_APPEND = "org.ops4j.pax.web.log.ncsa.append";
static final String PROPERTY_LOG_NCSA_EXTENDED = "org.ops4j.pax.web.log.ncsa.extended";
+ static final String PROPERTY_LOG_NCSA_DISPATCH = "org.ops4j.pax.web.log.ncsa.dispatch";
static final String PROPERTY_LOG_NCSA_LOGTIMEZONE = "org.ops4j.pax.web.log.ncsa.logtimezone";
static final String PROPERTY_LOG_NCSA_LOGDIR = "org.ops4j.pax.web.log.ncsa.directory";
@@ -91,7 +91,8 @@ void configureContext( Map<String, Object> attributes,
File getServerConfigDir();
- void configureRequestLog( String format, String retainDays, Boolean append, Boolean extend, String TimeZone, String directory );
+ void configureRequestLog( String format, String retainDays, Boolean append, Boolean extend, Boolean dispatch,
+ String TimeZone, String directory );
void addServletContainerInitializer(ContainerInitializerModel model);
@@ -463,7 +463,11 @@ public void removeSecurityConstraintMappings(final SecurityConstraintMappingMode
}
}
- public void configureRequestLog(String format, String retainDays, Boolean append, Boolean extend, String TimeZone, String directory) {
+
+ public void configureRequestLog(String format, String retainDays,
+ Boolean append, Boolean extend, Boolean dispatch,
+ String TimeZone, String directory) {
+
RequestLogHandler requestLogHandler = new RequestLogHandler();
@@ -483,11 +487,12 @@ public void configureRequestLog(String format, String retainDays, Boolean append
if (!directory.endsWith("/"))
directory += "/";
-
+
NCSARequestLog requestLog = new NCSARequestLog(directory + format);
requestLog.setRetainDays(Integer.parseInt(retainDays));
requestLog.setAppend(append);
requestLog.setExtended(extend);
+ requestLog.setLogDispatch(dispatch);
requestLog.setLogTimeZone(TimeZone);
requestLogHandler.setRequestLog(requestLog);
@@ -368,7 +368,8 @@ public void start()
if (m_configuration.isLogNCSAFormatEnabled()) {
m_jettyServer.configureRequestLog(m_configuration.getLogNCSAFormat(), m_configuration.getLogNCSARetainDays(),
- m_configuration.isLogNCSAAppend(),m_configuration.isLogNCSAExtended(),m_configuration.getLogNCSATimeZone(),m_configuration.getLogNCSADirectory());
+ m_configuration.isLogNCSAAppend(),m_configuration.isLogNCSAExtended(), m_configuration.isLogNCSADispatch(),
+ m_configuration.getLogNCSATimeZone(),m_configuration.getLogNCSADirectory());
}
m_jettyServer.start();
@@ -27,6 +27,7 @@
import static org.ops4j.pax.web.service.WebContainerConstants.PROPERTY_LISTENING_ADDRESSES;
import static org.ops4j.pax.web.service.WebContainerConstants.PROPERTY_LOG_NCSA_APPEND;
import static org.ops4j.pax.web.service.WebContainerConstants.PROPERTY_LOG_NCSA_EXTENDED;
+import static org.ops4j.pax.web.service.WebContainerConstants.PROPERTY_LOG_NCSA_DISPATCH;
import static org.ops4j.pax.web.service.WebContainerConstants.PROPERTY_LOG_NCSA_FORMAT;
import static org.ops4j.pax.web.service.WebContainerConstants.PROPERTY_LOG_NCSA_LOGTIMEZONE;
import static org.ops4j.pax.web.service.WebContainerConstants.PROPERTY_LOG_NCSA_RETAINDAYS;
@@ -323,6 +324,7 @@ private void determineServiceProperties(final Dictionary managedConfig,
setProperty(toPropagate, PROPERTY_LOG_NCSA_RETAINDAYS, config.getLogNCSARetainDays());
setProperty(toPropagate, PROPERTY_LOG_NCSA_APPEND, config.isLogNCSAAppend());
setProperty(toPropagate, PROPERTY_LOG_NCSA_EXTENDED, config.isLogNCSAExtended());
+ setProperty(toPropagate, PROPERTY_LOG_NCSA_DISPATCH, config.isLogNCSADispatch());
setProperty(toPropagate, PROPERTY_LOG_NCSA_LOGTIMEZONE, config.getLogNCSATimeZone());
if (JspSupportUtils.jspSupportAvailable()) {
@@ -377,6 +377,11 @@ public Boolean isLogNCSAExtended() {
return getResolvedBooleanProperty(PROPERTY_LOG_NCSA_EXTENDED);
}
+ public Boolean isLogNCSADispatch() {
+ return getResolvedBooleanProperty(PROPERTY_LOG_NCSA_DISPATCH);
+ }
+
+
public String getLogNCSATimeZone() {
return getResolvedStringProperty(PROPERTY_LOG_NCSA_LOGTIMEZONE);
}
@@ -35,11 +35,12 @@
<AD name="NCSA Log RetainDays" id="org.ops4j.pax.web.log.ncsa.retaindays" type="String" default="90" />
<AD name="NCSA Log Append" id="org.ops4j.pax.web.log.ncsa.append" type="String" default="true" />
<AD name="NCSA Log Expended" id="org.ops4j.pax.web.log.ncsa.extended" type="String" default="true" />
+ <AD name="NCSA Log Dispatch" id="org.ops4j.pax.web.log.ncsa.dispatch" type="String" default="false" />
<AD name="NCSA Log Time Zone" id="org.ops4j.pax.web.log.ncsa.logtimezone" type="String" default="GMT" />
<AD name="NCSA Log Directory" id="org.ops4j.pax.web.log.ncsa.directory" type="String" default="" />
</OCD>
<Designate pid="org.ops4j.pax.web">
<Object ocdref="org.ops4j.pax.web"/>
</Designate>
-</metatype:MetaData>
+</metatype:MetaData>
@@ -140,6 +140,8 @@
Boolean isLogNCSAAppend();
Boolean isLogNCSAExtended();
+
+ Boolean isLogNCSADispatch();
String getLogNCSATimeZone();

0 comments on commit 25c684e

Please sign in to comment.