This is an automated email from the ASF dual-hosted git repository.
yuqi4733 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 e5534a8b1e [#9278] improvement(server): Fix missing appender reference
for REST logger in log4j2 configuration (#9366)
e5534a8b1e is described below
commit e5534a8b1e9fd029dc09aee28e26e6496b0b4813
Author: Jerry Shao <[email protected]>
AuthorDate: Wed Dec 3 21:07:40 2025 +0800
[#9278] improvement(server): Fix missing appender reference for REST logger
in log4j2 configuration (#9366)
### What changes were proposed in this pull request?
This PR fixes a logging configuration issue where REST operation
exceptions were not being written to the server log file.
**Changes:**
- Added `logger.rest.appenderRef.rolling.ref = fileLogger` to
`conf/log4j2.properties.template`
**Root Cause:**
The REST logger (`org.apache.gravitino.server.web.rest`) was defined
with a log level and additivity setting, but was missing the appender
reference. This meant that when REST operations failed (e.g., invalid
storage location in fileset creation), the exception stack traces were
not written to `gravitino-server.log`, making server-side debugging
difficult.
**Impact:**
- REST operation failures now properly log exception stack traces to
gravitino-server.log
- Aligns template configuration with
`distribution/package/conf/log4j2.properties` (which already had this
fix)
- Improves server-side debuggability for operators
### Why are the changes needed?
Fix #9278
As reported in the issue, when REST API operations fail (such as
creating a fileset with invalid storage location `s://bucket`), there
are no error logs in the server side (gravitino-server.log). The client
receives error responses, but operators cannot debug the issue without
server-side logs.
This is a critical observability issue that affects production
deployments.
### Does this PR introduce _any_ user-facing change?
No user-facing changes. This is an internal logging configuration fix
that improves observability.
### How was this patch tested?
- Manual testing confirmed that REST operation exceptions now appear in
server logs
- Verified all other log4j2 configuration files don't have similar
issues
- Confirmed the fix aligns with the already-correct
`distribution/package/conf/log4j2.properties`
---
conf/log4j2.properties.template | 1 +
1 file changed, 1 insertion(+)
diff --git a/conf/log4j2.properties.template b/conf/log4j2.properties.template
index c3f31f5268..f0579d1265 100644
--- a/conf/log4j2.properties.template
+++ b/conf/log4j2.properties.template
@@ -74,6 +74,7 @@ logger.lineage.additivity = false
logger.rest.name = org.apache.gravitino.server.web.rest
logger.rest.level = warn
+logger.rest.appenderRef.rolling.ref = fileLogger
logger.rest.additivity = false
# Configure root logger