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 logging configuration. Let's first see what's in the root directory.
- Assistant
Let me first understand the repository structure and find the logging-related code, especially the JUL to SLF4J bridge configuration.
- Assistant
Let me understand the repository structure and find the logging bridge between JUL and SLF4J.
- Assistant
Let me look at the logging-related files, particularly DefaultLogger and LogFormatter.
- Assistant
Let me look at the key logging files:
- Assistant
Now let me look at the AnsiLogFormatter and the LogFormatter:
- Assistant
Now I see the issue. The
AnsiLogFormattergets the log record and usesString.formatted(additionalArgs)which uses Java'sprintf-style formatting. But gRPC'sManagedChannelImplusesjava.util.loggingwithjava.text.MessageFormat-style placeholders like{0},{1}etc. These are positional placeholders forMessageFormat.format(), notprintf-style%setc.So when gRPC logs something like
[{0}] Failed to resolve name. status={1}with parameters[channel-7, UNAVAILABLE: Unable to resolve host...], the formatter tries to applyString.formatted()which doesn't understand{0}style placeholders (it uses%s,%detc.), and the parameters are ignored.The fix should be in the
AnsiLogFormatter(orLogFormatterbase class) to detect MessageFormat-style placeholders and useMessageFormat.format()instead ofString.formatted().Let me look at the
LogFormatterbase class first. - Assistant
I can see the issue! Both
LogFormatterandAnsiLogFormatteruseString.formatted(additionalArgs)which isString.format()style (with%s,%dplaceholders). However, gRPC usesjava.text.MessageFormatstyle placeholders ({0},{1}).Let me also check if there are other files that have similar patterns and look at the existing test file:
- Assistant
Now I understand the problem. Let me examine how
LogFormatterandAnsiLogFormatterhandle parameters: - Assistant
Now I understand the root cause. Both
LogFormatterandAnsiLogFormatterusemessage.formatted(additionalArgs)which is Java'sString.format()style (with%s,%d). But gRPC's internal loggers usejava.util.loggingwithMessageFormat-style placeholders{0},{1}. The{0}is not a validString.format()specifier, so the parameters are silently ignored and the raw template is displayed.Let me check the project structure to find where we need to make changes:
- Assistant
Good,
java.text.*is already imported inLogFormatter.javawhich includesMessageFormat. Now let me implement the fix. The approach is to detectMessageFormat-style placeholders ({0},{1}, etc.) and useMessageFormat.format()instead ofString.formatted()for those messages.Let me first check if the
customFormatMessagemethod handles bothMessageFormatandString.formatpatterns correctly. The key insight is from the JDK's ownFormatter.formatMessage(): - Assistant
This confirms the problem perfectly. When
{0}style placeholders go throughString.formatted(), they remain as literal text. Now let me implement the fix.The fix needs to be in both
LogFormatter.customFormatMessage()andAnsiLogFormatter.customFormatMessage(). When parameters exist, we need to detect if the message usesMessageFormat-style placeholders ({0},{1}, etc.) and useMessageFormat.format()instead ofString.formatted().Let me start with
LogFormatter.java: - Assistant
Now I need to modify the
customFormatMessagemethod to useMessageFormat.format()when the message contains{0,{1, etc. style placeholders.The standard approach from JUL's
Formatter.formatMessage()checks for{0,{1,{2,{3in the message. If any of these are found, it usesMessageFormat.format().Let me update both
LogFormatter.javaandAnsiLogFormatter.java. - Assistant
Now I need to add the
formatMessageWithParametershelper method. Let me add it to theLogFormatterclass: - Assistant
Now let me update
AnsiLogFormatter.javato use the same method: - Assistant
Now I need to update the
AnsiLogFormatterto use theformatMessageWithParametersmethod from the parent class: - Assistant
Now let me verify both files look correct:
- Assistant
Both files look correct. Now let me write a quick test to verify the fix works:
- Assistant
The test failed on Test 5 because
MessageFormatformats numbers with locale-specific formatting (commas for thousands). This is expected behavior forMessageFormat- the JDK's ownFormatter.formatMessage()does the same thing. The gRPC messages use{0}placeholders with string arguments, so this is fine. Let me fix the test: - Assistant
All tests pass. Now let me verify the project compiles correctly with these changes:
- Assistant
Good, the engine module compiled successfully. Let me check if there are other places in the codebase that might have the same issue:
- Assistant
The
DefaultLoggerusesmessage.formatted()but that's for ArcadeDB's own logging (which uses%sstyle placeholders), not for processing incoming JULLogRecords from gRPC. My fix is in the right place -LogFormatterandAnsiLogFormatterwhich are the JULFormatterimplementations that processLogRecords from gRPC.Now let me run the existing
LoggerTestto make sure I haven't broken anything: - Assistant
Let me check if the tests actually passed:
- Assistant
All 4 tests passed. Let me also check if there are any tests for the formatters:
- Assistant
Let me verify the complete final state of both changed files:
- Assistant
The diff looks clean. Let me also check what
AnsiCode.format()does with curly braces to make sure we're not losing the{0}patterns during ANSI processing: - Assistant
Good,
AnsiCode.format()only processes$ANSI{...}patterns. The{0},{1}patterns from gRPC will pass through unchanged. This is safe.Let me also verify that
VariableParser.resolveVariablesdoesn't interfere with plain{0}: - Assistant
No output - maybe the method name is different. Let me check.
- Assistant
Good,
VariableParser.resolveVariablesonly processes patterns starting with$ANSI{, so plain{0}patterns from gRPC will pass through untouched.Now let me also check if there are any other test classes that might be affected:
- Assistant
There's no LogFormatter test class. Let me check the output more carefully.
- Assistant
All tests pass. Let me write a quick integration test to confirm the fix works end-to-end with actual
LogRecordobjects: - Assistant
Excellent! The fix works perfectly. The gRPC log messages are now properly formatted with the substituted values. Let me clean up the temporary files:
- Assistant
Let me do a final review of the changes:
- Assistant
Let me verify the final state of the files:
- Assistant
Let me verify the complete final state of the AnsiLogFormatter:
- Assistant
Let me run a broader test suite to make sure nothing else is broken:
- Assistant
The compile passes. Let me run the existing LoggerTest one more time to confirm everything is solid:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.