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 usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /arcadedb, current file: none) bash-$
Assistant
Let me analyze the issue:
- The problem is that gRPC's ManagedChannelImpl log messages contain unsubstituted placeholders ({0}, {1}) instead of actual values
- The root cause is that gRPC uses java.util.logging (JUL) with MessageFormat-style placeholders, and the bridge to SLF4J/Logback is not translating the parameters
- The fix should involve properly handling JUL LogRecord parameters
Let me start by exploring the repository structure to understand how logging is set up.
Assistant
Let me explore the repository structure more, focusing on logging-related files.
Assistant
Let me search for logging-related files, especially anything related to JUL (java.util.logging) bridges or gRPC logging.
Assistant
Good, I found some logging-related files. Let me look at the DefaultLogger.java and LogFormatter.java files which are likely the key files for logging infrastructure.
Assistant
Now let me look at the LogFormatter.java and AnsiLogFormatter.java to understand how formatting works:
Assistant
I see the issue now. The
LogFormatterclass usesmessage.formatted(additionalArgs)which usesString.format()style (with%s,%d, etc.), but gRPC usesMessageFormatstyle placeholders ({0},{1}). Let me verify this by looking at how gRPC logs:Assistant
Now I understand the problem. The
LogFormatter.customFormatMessage()andAnsiLogFormatter.customFormatMessage()both usemessage.formatted(additionalArgs)which is the JavaString.format()style (using%s,%d, etc.). However, gRPC's JUL loggers useMessageFormatstyle placeholders ({0},{1}).When gRPC creates a
LogRecordwith{0}placeholders and passes the parameters array, the current code triesmessage.formatted(args)which usesString.format()style. Since{0}is not valid forString.format(), it throwsIllegalFormatExceptionwhich is caught, and then the raw message with{0}placeholders is printed.The fix should check if the message contains MessageFormat-style placeholders (
{0},{1}, etc.) and useMessageFormat.format()in that case.Let me first look at the existing test file for the logger:
Assistant
Now I understand the issue. The
LogFormatter.format()andAnsiLogFormatter.format()methods usemessage.formatted(args)which expectsString.format()style placeholders like%s,%d, etc. But gRPC's JUL loggers useMessageFormatstyle placeholders like{0},{1}.When
message.formatted(args)is called with{0}style placeholders, it throwsIllegalFormatException, which is caught and the raw message (with placeholders) is output.The fix should try both formatting styles. Let me first create a test script to confirm the issue:
Assistant
Let me create a simple test script to reproduce the issue and confirm the fix:
Assistant
Interesting! I see that
String.formatdoesn't throw an exception for{0}placeholders - it just ignores them and outputs them literally. So the issue is thatmessage.formatted(params)doesn't throw an exception when given{0}style placeholders, it just doesn't substitute them.This means the current code in
LogFormatterandAnsiLogFormatterdoesn't detect that the formatting failed. Thecatch (IllegalFormatException ignore)block is never triggered for MessageFormat-style placeholders.Now let me understand the fix needed:
- The
LogFormatter.customFormatMessage()andAnsiLogFormatter.customFormatMessage()methods need to detect when the message contains MessageFormat-style placeholders ({0},{1}, etc.) and useMessageFormat.format()instead ofString.format().
Let me check if there's a pattern to detect MessageFormat-style placeholders:
- The
Assistant
Good, the detection pattern works. Now I need to implement the fix in both
LogFormatter.javaandAnsiLogFormatter.java. The fix should:- Check if the message contains MessageFormat-style placeholders (
{0},{1}, etc.) - If so, use
MessageFormat.format()to format the message - Otherwise, use the existing
String.format()style (message.formatted())
Let me implement the fix. I'll modify the
LogFormatter.javafirst:- Check if the message contains MessageFormat-style placeholders (
Assistant
The open command needs to be used differently. Let me try without the file argument in the JSON.
Assistant
Now I'll modify the
LogFormatter.javato add support for MessageFormat-style placeholders. The key change is in thecustomFormatMessagemethod where the message formatting happens. I need to:- Add a
MessageFormatimport - Modify the formatting logic to detect and use MessageFormat when appropriate
- Add a
Assistant
Now let me also update the
AnsiLogFormatter.javawith the same fix:Assistant
Now let me verify the changes compile correctly by running the build:
Assistant
I need to add the
Patternimport. Thejava.util.*import doesn't includePattern- I need to addjava.util.regex.Patternexplicitly. Let me fix this:Assistant
Now let me try to compile again:
Assistant
The code compiles. Now let me create a test script to verify the fix works correctly:
Assistant
Test 6 shows that
MessageFormatformats numbers with locale-specific separators (2,424 instead of 2424). This is expected behavior forMessageFormatand is actually correct - it's how Java'sMessageFormatworks. gRPC would be fine with this since it typically logs strings and status objects, not raw integers. Let me adjust the test to account for locale:Assistant
All tests pass. Now let me run the existing tests in the engine module to make sure I haven't broken anything:
Assistant
The LoggerTest passed. Let me also check if there are any tests specifically for the LogFormatter or AnsiLogFormatter:
Assistant
Let me check if there are any more tests related to logging:
Assistant
Let me verify the changes I've made by looking at the diff:
Assistant
The changes look correct. Let me run a broader set of tests to make sure everything still works:
Assistant
Tests passed. Let me also run a quick integration test by writing a more comprehensive test that uses the actual LogFormatter classes:
Assistant
Now let me create a test script that tests the actual LogFormatter classes to confirm the fix works end-to-end:
Assistant
The fix works correctly:
- MessageFormat style placeholders (
{0},{1}): Now properly substituted with actual values (e.g.,[channel-7] Failed to resolve name. status=UNAVAILABLE: Unable to resolve host) - String.format style placeholders (
%s): Still work correctly (e.g.,[my-logger] Connected to server-1)
Let me also run a broader set of tests to make sure nothing is broken:
- MessageFormat style placeholders (
Assistant
The full test suite takes too long. Let me just run a few more specific tests that are most likely to be affected:
Assistant
All tests pass. Let me also think about edge cases:
- Null parameters: Handled - the code checks
if (additionalArgs != null)before processing - Empty parameters array: Handled - the pattern matcher won't find anything and the message is output as-is
- Mixed placeholders: If a message has both
{0}and%s, the code will use MessageFormat for the{0}pattern, which is the correct behavior since gRPC-style messages use MessageFormat - Braces without digit pattern: The regex
\{\d+\}specifically matches{0},{1}, etc. but not arbitrary text in braces like{ some text } - No placeholders: The pattern won't match, so the original
message.formatted()path is not taken when there are no args (falls tobuffer.append(message))
Let me verify edge case handling one more time:
- Null parameters: Handled - the code checks
Assistant
All edge cases pass. Let me now clean up the temporary test files and verify the final state of my changes:
Assistant
Let me view the final state of both modified files to confirm everything is correct:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →