ISSUE DESCRIPTION gRPC ManagedChannelImpl log messages contain unsubstituted…
- User
ISSUE DESCRIPTION
gRPC ManagedChannelImpl log messages contain unsubstituted placeholders Affected version: ArcadeDB server 26.4.2 Component: logging — bridge between gRPC's java.util.logging and the server's SLF4J/Logback backend
Summary
Some WARNING messages emitted by gRPC's ManagedChannelImpl are written to the ArcadeDB server log with the original MessageFormat placeholders ({0}, {1}) left literal instead of being substituted with the actual values.
Example
2026-05-21 06:53:11.234 WARNI [ManagedChannelImpl] [{0}] Failed to resolve name. status={1} 2026-05-21 06:53:11.234 WARNI [ManagedChannelImpl] [{0}] Failed to resolve name. status={1}
Expected (illustrative):
WARNI [ManagedChannelImpl] [channel-7] Failed to resolve name. status=UNAVAILABLE: Unable to resolve host vcc-superx-arcadedb-2.…
Root cause (suspected)
gRPC's internal loggers use java.util.logging with MessageFormat-style placeholders. The bridge that forwards JUL records to the ArcadeDB logging backend (SLF4J/Logback) is not translating {0}, {1} parameters into the SLF4J {} style, so the parameter array is dropped and the raw template ends up in the log file. Confirmation: the same logical event is also logged elsewhere (via GrpcLogAppender / AppendLogResponseHandler) with the full formatted message, so the data exists — it's just lost on the ManagedChannelImpl path.
Impact
Low severity but operationally annoying — these log lines carry zero information, so anyone scanning logs for the actual channel and gRPC status gets a stream of [{0}] Failed to resolve name. status={1} that they then have to correlate with neighbouring lines.
Suggested fix
Either:
- Install SLF4JBridgeHandler (org.slf4j:jul-to-slf4j) and ensure it translates JUL LogRecord.parameters via MessageFormat.format(...) before delegating to SLF4J; or
- Configure a JUL Handler for the io.grpc logger that uses a SimpleFormatter-compatible formatter so parameters are substituted before the message reaches the SLF4J side.
Environment
- ArcadeDB 26.4.2, default packaging
- Logs viewed via kubectl logs; same behaviour observed across all 3 HA pods
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can use and to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call ) using or commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. - Assistant
I'll start by exploring the repository structure to understand the codebase and locate relevant files for the logging issue. Let's first see what's in the root directory.
- Assistant
Let me look for logging-related files and gRPC-related files.
- Assistant
Let me look at the logging bridge between JUL and SLF4J in the server code. The key files are likely
ServerLogManager.javaand possiblyGrpcLoggingInterceptor.java. - Assistant
Let me look at the GrpcLoggingInterceptor and search for where JUL logging is bridged to SLF4J.
- Assistant
Now let me look at the LogManager class to understand how logging is handled, and also search for any JUL-to-SLF4J bridge configuration.
- Assistant
Let me find the LogManager class
- Assistant
Let me look at the LogManager.java file.
- Assistant
Let me look at the Logger interface and DefaultLogger to understand the logging chain.
- Assistant
Let me search for where JUL logging is bridged to SLF4J in the codebase.
- Assistant
Now let me look for how JUL-to-SLF4J bridge is configured, and the DefaultLogger implementation.
- Assistant
Let me explore the repository structure to understand the project better.
- Assistant
Now let me look at the AnsiLogFormatter which is the custom formatter used for JUL.
- Assistant
Let me check how JUL logs are bridged to the server's logging system.
- Assistant
Now I can see the issue. In
AnsiLogFormatter.customFormatMessage(), the code usesmessage.formatted(additionalArgs)which uses Java'sString.formatted()which uses%sstyle placeholders. But gRPC's JUL loggers useMessageFormatstyle placeholders ({0},{1}).Let me also check the
LogFormatterclass to see the base implementation. - Assistant
Let me look at the
LogFormatterbase class to understand the full flow. - Assistant
Now I understand the issue clearly. The problem is in both
LogFormatter.customFormatMessage()andAnsiLogFormatter.customFormatMessage(). They usemessage.formatted(additionalArgs)which is Java'sString.formatted()method that uses%sstyle placeholders (likeprintf). However, gRPC's JUL loggers usejava.text.MessageFormatstyle placeholders ({0},{1}, etc.).Let me first look at the project structure to understand how to build and test.
- Assistant
Now I understand the issue. Both
LogFormatter.customFormatMessage()andAnsiLogFormatter.customFormatMessage()usemessage.formatted(additionalArgs)which is Java'sString.formatted()using%s-style placeholders. However, gRPC's JUL loggers usejava.text.MessageFormat-style placeholders ({0},{1}, etc.). The parameters array exists but the%s-style formatter doesn't substitute{0},{1}placeholders.Let me also check if there are any tests for the log formatter:
- Assistant
Let me check the existing test:
- Assistant
Now I understand the issue. When gRPC's
ManagedChannelImpllogs via JUL withMessageFormat-style placeholders ({0},{1}), the log record flows through the JUL handler →LogFormatter/AnsiLogFormatter. Both formatters try to format usingmessage.formatted(additionalArgs)which is Java'sString.formatted()(printf-style, expects%s), so{0},{1}placeholders are left unsubstituted.The fix is to use
java.text.MessageFormat.format()forMessageFormat-style placeholders (the standard JUL approach). Let me implement this in both formatters. - Assistant
Now I understand the problem clearly. The
customFormatMessagemethod in bothLogFormatterandAnsiLogFormatterusesmessage.formatted(additionalArgs)which isString.formatted()(uses%s-style placeholders). But gRPC loggers useMessageFormat-style placeholders ({0},{1}). The standard JULFormatter.formatMessage()already handles this by checking for{0}patterns and usingMessageFormat.format(). Let me implement the fix.First, let me add a helper method to
LogFormatterthat properly handles both placeholder styles: - Assistant
Now let me see the rest of the file and then fix it.
- Assistant
Now I fully understand the problem. The
customFormatMessagemethod inLogFormatterusesmessage.formatted(additionalArgs)which is Java'sString.formatted()(printf-style%splaceholders). But gRPC's loggers useMessageFormat-style placeholders ({0},{1}). The parameters exist in theLogRecordbut aren't being substituted.I need to modify the message formatting in
LogFormatter.customFormatMessage()to first tryMessageFormat.format()for{0}-style patterns, and fall back toString.formatted()for%s-style patterns. - Assistant
Now I need to add the
formatLogMessagehelper method. Let me add it before thegetSourceClassSimpleNamemethod: - Assistant
There seems to be a duplicate closing brace. Let me check the end of the file:
- Assistant
There's a duplicate closing brace. Let me fix that:
- Assistant
Good. Now I need to update
AnsiLogFormatterto use the sameformatLogMessagemethod. Let me look at it again: - Assistant
The
AnsiLogFormatterhas its owncustomFormatMessagethat overrides the parent. It has the same issue - usingmessage.formatted(additionalArgs). Since it extendsLogFormatter, it can use the newformatLogMessagemethod. Let me update it: - Assistant
I see there's a duplicate comment "// FORMAT THE MESSAGE". Let me fix that:
- Assistant
Still duplicate. Let me remove the duplicate line:
- Assistant
Good, both files look clean. Let me verify the final state of both files:
- Assistant
Good, the
LogFormatter.javafile looks correct. Let me also verify AnsiLogFormatter: - Assistant
Both files look correct. Now let me create a quick test script to verify the fix works:
- Assistant
Interesting. Test 4 shows a potential issue with
MessageFormatwhen the message contains non-numeric{...}patterns. Let me investigate: - Assistant
Let me fix the test.
- Assistant
Good. MessageFormat.format properly throws IllegalArgumentException for invalid patterns (like
{some-text}), and our code falls back to printf-style in that case. For printf-style messages without{digit}patterns, it won't enter the MessageFormat path at all.Let me also check an edge case with single quotes (MessageFormat treats them specially):
- Assistant
The single-quote edge case is worth noting:
MessageFormattreats'as an escape character, so"User's session {0}"won't substitute{0}. But this is the same behavior as standard JUL'sFormatter.formatMessage()and is unlikely to affect real log messages. If the MessageFormat path produces wrong output due to quotes, the fallthrough toString.formatted()would handle it. However, we should handle this edge case more robustly.Actually, looking at the standard JUL
Formatter.formatMessage()source code, it uses the same approach. Let me make the detection smarter - only use MessageFormat when we detect{digit}patterns AND the message doesn't use printf-style%format specifiers: - Assistant
Good. The implementation looks correct. The key behaviors:
- gRPC-style
{0},{1}→MessageFormat.format()substitutes them correctly ✓ - Printf-style
%s→String.formatted()handles them correctly ✓ - No parameters → no formatting at all ✓
- Non-numeric
{text}→ no{digit}detected → falls through toString.formatted()✓
This matches the standard JUL
Formatter.formatMessage()behavior. Now let me compile and run the existing tests. - gRPC-style
- Assistant
Let me compile the engine module to verify our changes compile correctly:
- Assistant
HOME isn't set. Let me set it and try again.
- Assistant
Compilation succeeded. Now let me run the existing LoggerTest:
- Assistant
Tests pass. Let me also run the GrpcLoggingInterceptorTest:
- Assistant
That's just a dependency resolution issue. Let me try building more broadly to verify my changes work correctly:
- Assistant
All 4 existing tests pass. Now let me write a quick script to directly test the formatter with the exact gRPC scenario from the issue:
- Assistant
Let me run the test:
- Assistant
All tests pass perfectly. The fix works as expected:
- gRPC
{0},{1}MessageFormat-style placeholders are now properly substituted - Printf-style
%splaceholders still work correctly - Messages with no parameters still work correctly
Let me also clean up and run a broader test to ensure nothing is broken:
- gRPC
- Assistant
Let me check for any other tests that reference these formatters:
- Assistant
Only LoggerTest references them, and it passes. Let me also look at the GrpcLoggingInterceptorTest to see if there's anything related:
- Assistant
Good. The GrpcLoggingInterceptorTest doesn't directly test the formatter - it tests the interceptor behavior with mocks. My changes don't affect it.
Let me verify the full diff of my changes:
- Assistant
The diff looks clean and correct. Let me do a final review of all changes:
-
LogFormatter.java: AddedformatLogMessage()andcontainsMessageFormatPlaceholder()helper methods. Changed message formatting to use these helpers instead of directly callingmessage.formatted(). Broadened catch fromIllegalFormatExceptiontoExceptionto handleMessageFormat.format()exceptions. -
AnsiLogFormatter.java: Same change - uses inheritedformatLogMessage()instead ofmessage.formatted(). Same catch broadening.
Now let me run the LoggerTest one final time to confirm everything passes:
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.