Configure Undertow's access log prefix and suffix

This commit adds two properties that can be used to customize the prefix
and suffix of the Undertow's access log.

Closes gh-6652
This commit is contained in:
Stephane Nicoll
2016-08-22 10:12:26 +02:00
parent 9420daf001
commit a6ef3741ef
4 changed files with 62 additions and 2 deletions

View File

@@ -1270,6 +1270,12 @@ public class ServerProperties
if (this.accesslog.pattern != null) {
factory.setAccessLogPattern(this.accesslog.pattern);
}
if (this.accesslog.prefix != null) {
factory.setAccessLogPrefix(this.accesslog.prefix);
}
if (this.accesslog.suffix != null) {
factory.setAccessLogSuffix(this.accesslog.suffix);
}
if (this.accesslog.enabled != null) {
factory.setAccessLogEnabled(this.accesslog.enabled);
}
@@ -1340,6 +1346,16 @@ public class ServerProperties
*/
private String pattern = "common";
/**
* Log file name prefix.
*/
protected String prefix = "access_log.";
/**
* Log file name suffix.
*/
private String suffix = "log";
/**
* Undertow access log directory.
*/
@@ -1361,6 +1377,22 @@ public class ServerProperties
this.pattern = pattern;
}
public String getPrefix() {
return this.prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getSuffix() {
return this.suffix;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
public File getDir() {
return this.dir;
}