static Valve createAccessLogValve(final Container container, final String logDirectory, final ModelNode element) {
boolean extended = false;
if (element.hasDefined(Constants.EXTENDED)) {
extended = element.get(Constants.EXTENDED).asBoolean();
}
final AccessLogValve log;
if (extended) {
log = new ExtendedAccessLogValve();
} else {
log = new AccessLogValve();
}
log.setDirectory(logDirectory);
if (element.hasDefined(Constants.RESOLVE_HOSTS)) log.setResolveHosts(element.get(Constants.RESOLVE_HOSTS).asBoolean());
if (element.hasDefined(Constants.ROTATE)) log.setRotatable(element.get(Constants.ROTATE).asBoolean());
if (element.hasDefined(Constants.PATTERN)) {
log.setPattern(element.get(Constants.PATTERN).asString());
} else {
log.setPattern("common");
}
if (element.hasDefined(Constants.PREFIX)) log.setPrefix(element.get(Constants.PREFIX).asString());
return log;
}