diff --git a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java index 9ace2aacfb..914624977c 100644 --- a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java +++ b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java @@ -236,6 +236,7 @@ public class NiFiProperties extends ApplicationProperties { public static final String WEB_REQUEST_TIMEOUT = "nifi.web.request.timeout"; public static final String WEB_REQUEST_IP_WHITELIST = "nifi.web.request.ip.whitelist"; public static final String WEB_SHOULD_SEND_SERVER_VERSION = "nifi.web.should.send.server.version"; + public static final String WEB_REQUEST_LOG_FORMAT = "nifi.web.request.log.format"; // ui properties public static final String UI_BANNER_TEXT = "nifi.ui.banner.text"; diff --git a/nifi-docs/src/main/asciidoc/administration-guide.adoc b/nifi-docs/src/main/asciidoc/administration-guide.adoc index 516800fdfd..d414e52a2e 100644 --- a/nifi-docs/src/main/asciidoc/administration-guide.adoc +++ b/nifi-docs/src/main/asciidoc/administration-guide.adoc @@ -3877,6 +3877,19 @@ blank meaning all requests containing a proxy context path are rejected. Configu |`nifi.web.max.access.token.requests.per.second`|The maximum number of requests for login Access Tokens from a connection per second. Requests in excess of this are rejected with HTTP 429. |`nifi.web.request.ip.whitelist`|A comma separated list of IP addresses. Used to specify the IP addresses of clients which can exceed the maximum requests per second (`nifi.web.max.requests.per.second`). Does not apply to web request timeout. |`nifi.web.request.timeout`|The request timeout for web requests. Requests running longer than this time will be forced to end with a HTTP 503 Service Unavailable response. Default value is `60 secs`. +|`nifi.web.request.log.format`|The parameterized format for HTTP request log messages. +The format property supports the modifiers and codes described in the Jetty +link:https://www.eclipse.org/jetty/javadoc/jetty-9/org/eclipse/jetty/server/CustomRequestLog.html[CustomRequestLog^]. + +The default value uses the Combined Log Format, which follows the +link:https://en.wikipedia.org/wiki/Common_Log_Format[Common Log Format^] with the addition of `Referer` and `User-Agent` +request headers. The default value is: + +`%{client}a - %u %t "%r" %s %O "%{Referer}i" "%{User-Agent}i"` + +The CustomRequestLog writes formatted messages using the following SLF4J logger: + +`org.apache.nifi.web.server.RequestLog` |==== [[security_properties]] diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml index 34373b9e3b..a965cf92bd 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml @@ -136,6 +136,7 @@ 60 secs true + %{client}a - %u %t "%r" %s %O "%{Referer}i" "%{User-Agent}i" false 10 secs diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml index 93a9afaef1..2080b5ec07 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml @@ -57,6 +57,17 @@ + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request.log + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-request_%d.log + 30 + + + %msg%n + + + ${org.apache.nifi.bootstrap.config.log.dir}/nifi-bootstrap.log @@ -170,6 +181,10 @@ + + + +