This is an automated email from the ASF dual-hosted git repository.
jerryshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 11bd60d7e3 [MINOR] fix(server): Suppress verbose JCasbin authorization
logs (#13270)
11bd60d7e3 is described below
commit 11bd60d7e3e5a862a4b58fe6e860edc34e642679
Author: roryqi <[email protected]>
AuthorDate: Thu Sep 17 19:40:07 2026 +0800
[MINOR] fix(server): Suppress verbose JCasbin authorization logs (#13270)
### What changes were proposed in this pull request?
Configure the `org.casbin.jcasbin` logger at WARN by default in the
distribution and Helm logging configurations.
Add `log4j2Properties.jcasbinLoggerLevel` to allow Helm users to
override
the default, with tests covering both default and customized values.
### Why are the changes needed?
JCasbin logs every authorization decision at INFO. Workloads that
perform
many authorization checks can therefore generate several megabytes of
mostly redundant logs within seconds.
Gravitino already provides authorization diagnostics at DEBUG, so these
dependency-level decision logs should not be enabled by default.
### Does this PR introduce _any_ user-facing change?
JCasbin authorization decision logs are no longer emitted at the default
INFO level. Helm users can configure the level through
`log4j2Properties.jcasbinLoggerLevel`.
### How was this patch tested?
- `helm unittest --with-subchart=false dev/charts/gravitino`
- `./gradlew spotlessCheck`
- `git diff --check`
---
conf/log4j2.properties.template | 4 ++++
dev/charts/gravitino/resources/config/log4j2.properties | 4 ++++
dev/charts/gravitino/tests/configmap_test.yaml | 10 ++++++++++
dev/charts/gravitino/values.yaml | 3 +++
4 files changed, 21 insertions(+)
diff --git a/conf/log4j2.properties.template b/conf/log4j2.properties.template
index ff27eb3e0b..1952d6ae06 100644
--- a/conf/log4j2.properties.template
+++ b/conf/log4j2.properties.template
@@ -106,6 +106,10 @@ logger.rest.level = warn
logger.rest.appenderRef.rolling.ref = fileLogger
logger.rest.additivity = false
+# Suppress verbose JCasbin authorization decision logs by default
+logger.jcasbin.name = org.casbin.jcasbin
+logger.jcasbin.level = warn
+
# Configure root logger
rootLogger.level = info
rootLogger.appenderRef.rolling.ref = fileLogger
diff --git a/dev/charts/gravitino/resources/config/log4j2.properties
b/dev/charts/gravitino/resources/config/log4j2.properties
index 20575d9333..e6101c9517 100644
--- a/dev/charts/gravitino/resources/config/log4j2.properties
+++ b/dev/charts/gravitino/resources/config/log4j2.properties
@@ -47,6 +47,10 @@ appender.rolling.strategy.delete.ifLastModified.type = {{
.Values.log4j2Properti
# Delete all files older than 30 days
appender.rolling.strategy.delete.ifLastModified.age = {{
.Values.log4j2Properties.rollingAppenderStrategyDeleteIfLastModifiedAge |
default "30d" }}
+# Suppress verbose JCasbin authorization decision logs by default
+logger.jcasbin.name = org.casbin.jcasbin
+logger.jcasbin.level = {{ .Values.log4j2Properties.jcasbinLoggerLevel |
default "warn" }}
+
# Configure root logger
rootLogger.level = {{ .Values.log4j2Properties.rootLoggerLevel | default
"info" }}
rootLogger.appenderRef.rolling.ref = {{
.Values.log4j2Properties.rootLoggerAppenderRefRollingRef | default "fileLogger"
}}
diff --git a/dev/charts/gravitino/tests/configmap_test.yaml
b/dev/charts/gravitino/tests/configmap_test.yaml
index d34ac33e27..d0d9964d86 100644
--- a/dev/charts/gravitino/tests/configmap_test.yaml
+++ b/dev/charts/gravitino/tests/configmap_test.yaml
@@ -49,6 +49,12 @@ tests:
- matchRegex:
path: data["log4j2.properties"]
pattern: "rootLogger\\.level = info"
+ - matchRegex:
+ path: data["log4j2.properties"]
+ pattern: "logger\\.jcasbin\\.name = org\\.casbin\\.jcasbin"
+ - matchRegex:
+ path: data["log4j2.properties"]
+ pattern: "logger\\.jcasbin\\.level = warn"
- it: renders customized Gravitino and log4j configuration
release:
@@ -63,6 +69,7 @@ tests:
gravitino.custom.setting: "{{ .Values.entity.store }}"
log4j2Properties:
rootLoggerLevel: debug
+ jcasbinLoggerLevel: debug
additionalLog4j2Properties:
logger.custom.name: org.apache.gravitino.Custom
asserts:
@@ -81,6 +88,9 @@ tests:
- matchRegex:
path: data["log4j2.properties"]
pattern: "rootLogger\\.level = debug"
+ - matchRegex:
+ path: data["log4j2.properties"]
+ pattern: "logger\\.jcasbin\\.level = debug"
- matchRegex:
path: data["log4j2.properties"]
pattern: "logger\\.custom\\.name = org\\.apache\\.gravitino\\.Custom"
diff --git a/dev/charts/gravitino/values.yaml b/dev/charts/gravitino/values.yaml
index f7238d9d5c..40c72d86ad 100644
--- a/dev/charts/gravitino/values.yaml
+++ b/dev/charts/gravitino/values.yaml
@@ -472,6 +472,9 @@ log4j2Properties: {}
## Delete all files older than 30 days
# rollingAppenderStrategyDeleteIfLastModifiedAge: 30d
+ ## JCasbin logger
+ # jcasbinLoggerLevel: warn
+
## Configure root logger
# rootLoggerLevel: info
# rootLoggerAppenderRefRollingRef: fileLogger