From 96ec8e7ea2d1c157d182f209459d877b7bc1e1fe Mon Sep 17 00:00:00 2001 From: gaetanbrl Date: Tue, 31 Mar 2026 15:18:03 +0000 Subject: [PATCH 1/2] gateway - Add logging config --- gateway/gateway.yaml | 2 +- gateway/logging.yaml | 72 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 gateway/logging.yaml diff --git a/gateway/gateway.yaml b/gateway/gateway.yaml index 9a9fd7f..85a6e31 100644 --- a/gateway/gateway.yaml +++ b/gateway/gateway.yaml @@ -2,7 +2,7 @@ # configure target base URL's, headers and role based access, per service name. # Replaces security-proxy's targets-mapping.properties, headers-mapping.properties, and security-mappings.xml # -spring.config.import: application.yaml, security.yaml, routes.yaml, roles-mappings.yaml +spring.config.import: application.yaml, security.yaml, routes.yaml, roles-mappings.yaml, logging.yaml georchestra: gateway: diff --git a/gateway/logging.yaml b/gateway/logging.yaml new file mode 100644 index 0000000..7ddc3a9 --- /dev/null +++ b/gateway/logging.yaml @@ -0,0 +1,72 @@ +# Logging profiles + +# default profile: +logging: + # Control behavior of the access logging. When enabled, the request logs will include the URI's that match + # the following regular expressions at the specified level. + # Additionally, if the json-logs spring profile is enabled, the log entries will include MDC attributes configured in the logging.mdc.include.* properties below + accesslog: + enabled: true + # A list of java regular expressions applied to the request URL for logging at info level + # Includes OGC service requests which are proxied to GeoServer + info: + - .*/(?:ows|ogc|wms|wfs|wcs|wps)(?:/.*|\?.*)?$ + # A list of java regular expressions applied to the request URL for logging at debug level + debug: + - ".*/console/.*" + # A list of java regular expressions applied to the request URL for logging at trace level + # The default behavior is to EXCLUDE known static resources and image files + trace: + - ^(?!.*/web/wicket/resource/)(?!.*\.(png|jpg|jpeg|gif|svg|webp|ico)(\?.*)?$).*$ + + # Configuration to inject auth, application, and http request attributes to the logging MDC. + # The following are default values. The MDC attributes will be automatically + # included when using the json-logs profile. For the regular console output you could tweak the logback-spring.xml + # config file to include the required MDC properties + # In any case, the activated MDC will be visible when using the OpenTelemetry protocol + mdc: + include: + user: + id: true + roles: false + org: true + extras: false + auth-method: false + application: + name: true + version: true + instance-id: true + active-profiles: false + http: + id: true + method: true + path: true + query-string: false + parameters: false + headers: false + headers-pattern: ".*" + cookies: false + remote-addr: false + remote-host: false + session-id: false + level: + root: warn + org.springframework: warn + org.georchestra.gateway: info + org.georchestra.gateway.accesslog: info +--- +spring.config.activate.on-profile: logging_debug +logging: + level: + root: info + org.springframework: info + org.georchestra.gateway: debug + org.georchestra.gateway.accesslog: debug + org.georchestra.gateway.logging: debug + +--- +spring.config.activate.on-profile: logging_debug_security +logging: + level: + org.springframework.security: debug + org.georchestra.gateway.security: debug From 1a1bcf634ec43253ae459b53e0d4350fc629ecdc Mon Sep 17 00:00:00 2001 From: gaetanbrl Date: Tue, 31 Mar 2026 21:37:13 +0200 Subject: [PATCH 2/2] Change logging level from debug to info --- gateway/logging.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gateway/logging.yaml b/gateway/logging.yaml index 7ddc3a9..f53fb5b 100644 --- a/gateway/logging.yaml +++ b/gateway/logging.yaml @@ -60,13 +60,13 @@ logging: level: root: info org.springframework: info - org.georchestra.gateway: debug - org.georchestra.gateway.accesslog: debug - org.georchestra.gateway.logging: debug + org.georchestra.gateway: info + org.georchestra.gateway.accesslog: info + org.georchestra.gateway.logging: info --- spring.config.activate.on-profile: logging_debug_security logging: level: - org.springframework.security: debug - org.georchestra.gateway.security: debug + org.springframework.security: info + org.georchestra.gateway.security: info