@Override
public void start(ResourceContext<BaseComponent<?>> resourceContext) throws InvalidPluginConfigurationException, Exception {
super.start(resourceContext);
Configuration pluginConfig = resourceContext.getPluginConfiguration();
ResponseTimeConfiguration responseTimeConfig = new ResponseTimeConfiguration(pluginConfig);
File logFile = responseTimeConfig.getLogFile();
if (logFile == null) {
logFile = findLogFile();
}
if (logFile != null) {
if (getLog().isDebugEnabled()) {
if (logFile.isFile()) {
getLog().debug("[" + resourceContext.getResourceKey() + "] is using the response time log file ["
+ logFile + "]");
} else {
getLog().debug("The response time log file [" + logFile + "] for ["
+ resourceContext.getResourceKey() + "] does not exist yet.");
}
}
this.responseTimeLogParser = new ResponseTimeLogParser(logFile);
this.responseTimeLogParser.setExcludes(responseTimeConfig.getExcludes());
this.responseTimeLogParser.setTransforms(responseTimeConfig.getTransforms());
} else {
if (getLog().isDebugEnabled()) {
getLog().debug("Cannot monitor response time for [" + resourceContext.getResourceKey()
+ "] - unknown log file location");
}