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
Let me understand the issue:
- gRPC's ManagedChannelImpl log messages contain unsubstituted placeholders ({0}, {1})
- The root cause is that the bridge between java.util.logging (JUL) and SLF4J/Logback is not properly translating MessageFormat placeholders to SLF4J style
- The fix should involve properly handling JUL LogRecord parameters
Let me start by exploring the repository structure to understand how the logging is set up.
Assistant
Let me explore the repository structure more to find the logging-related files.
Assistant
Let me look at the log-related files and also search for any existing logging bridge/handler:
Assistant
The user seems to have encountered an error with my tool call. Let me try the correct syntax for the open command.
Assistant
I can see the LogManager uses java.util.logging.Level but the actual logging is done through a Logger interface. Let me look at the Logger and DefaultLogger classes to understand how the logging works.
Assistant
Now I understand the structure. The DefaultLogger uses
java.util.logging(JUL) as its underlying framework. The issue is that gRPC uses JUL with MessageFormat-style placeholders ({0}, {1}), but the DefaultLogger's formatter (AnsiLogFormatter) doesn't handle the parameters from LogRecord properly.Let me look at the AnsiLogFormatter to understand how messages are formatted:
Assistant
I found the issue! The
AnsiLogFormatter(and potentiallyLogFormatter) usesmessage.formatted(additionalArgs)which is Java'sString.format()style with%s,%dplaceholders. However, gRPC usesjava.util.loggingwithMessageFormatstyle placeholders like{0},{1}.Let me check the
LogFormatterclass as well:Assistant
Now I can see the problem clearly. Both
LogFormatterandAnsiLogFormatterusemessage.formatted(additionalArgs)which is Java'sString.format()style that expects%s,%dplaceholders. However, gRPC usesjava.util.loggingwithMessageFormat-style placeholders like{0},{1}.The fix should be to use
java.text.MessageFormat.format(message, additionalArgs)instead ofmessage.formatted(additionalArgs)when formatting the message. However, this could break existing code that uses%sstyle formatting.Let me look at how gRPC logs messages and how the existing tests work:
Assistant
Let me check if there are any existing tests for the LogFormatter:
Assistant
I need to continue exploring the codebase to understand how logging is used and find the best place to fix the MessageFormat issue. Let me check if there are any logger tests.
Assistant
Now I understand the issue. The problem is in
LogFormatter.customFormatMessage()andAnsiLogFormatter.customFormatMessage()which both usemessage.formatted(additionalArgs)— this is Java'sString.format()style that expects%s,%dformat specifiers. However, gRPC usesjava.util.loggingwithMessageFormat-style placeholders like{0},{1}.The fix should be to use
java.text.MessageFormat.format()for formatting the message when parameters are provided, which is the standard behavior for JUL log records. The JULLogFormatter.formatMessage()method already does this, but bothLogFormatterandAnsiLogFormatteroverride it with their own implementation that usesString.formatted().Let me verify this understanding by checking what the default JUL
Formatterdoes:Assistant
The grep command seems to be failing. Let me try a different approach.
Assistant
Good, that confirms there's no
MessageFormatbeing used currently. The fix is to change bothLogFormatterandAnsiLogFormatterto usejava.text.MessageFormat.format()instead ofString.formatted()when formatting messages with parameters.Let me first create a small test script to confirm the issue and then verify the fix:
Assistant
The test confirms the issue:
String.formatted()does NOT substitute{0},{1}placeholders - they remain literalMessageFormat.format()correctly substitutes{0},{1}placeholders
Now I need to think about backward compatibility. If I simply replace
message.formatted()withMessageFormat.format():{0},{1}style placeholders will work correctly (gRPC)%s,%dstyle placeholders would NOT work (current ArcadeDB code)
So I need to detect which format style is being used and apply the appropriate formatter. Let me check how ArcadeDB currently formats its messages:
Assistant
I see that ArcadeDB uses
%s,%dstyle formatting extensively. However, the key insight is that when messages come from ArcadeDB code, they're typically formatted before being passed to the logger. Themessage.formatted(args)call in the formatters is specifically for handling messages that come from external sources (like gRPC) via JUL'sLogRecordmechanism.Let me verify how messages flow through the system:
Assistant
Now I understand the flow:
- When ArcadeDB code logs via
LogManager.log(), the message is formatted withmessage.formatted(args)inDefaultLogger.log()before being passed to JUL'slog.log(level, msg). So the message is already fully formatted - no parameters in the LogRecord. - When gRPC logs directly to JUL (like
ManagedChannelImpl), it creates aLogRecordwith the template message and parameters array. The formatter then tries to format it.
The fix should be in the
LogFormatter.customFormatMessage()andAnsiLogFormatter.customFormatMessage()methods. When formatting a message with parameters, we should tryMessageFormat.format()first (which handles{0},{1}style) and fall back to the original behavior if it fails.Actually, looking at this more carefully:
MessageFormat.format()handles{0},{1}style placeholders correctlyMessageFormat.format()does NOT interpret , as format specifiers - it treats them as literal text
- When ArcadeDB code logs via
Assistant
Good. When
DefaultLoggerlogs to JUL, it callslog.log(level, msg)wheremsgis already the formatted string. The JUL logger then creates aLogRecordwith just the message (no parameters). So the formatter won't see any parameters for ArcadeDB's own messages.For external JUL loggers (like gRPC), they create
LogRecordwith both the template message and the parameters array. The formatter should handle this case.The proper fix is to use
MessageFormat.format()in the formatters when parameters are present, since that's what JUL's standardFormatter.formatMessage()uses. Let me implement this fix:Assistant
Now let me modify the
LogFormatterto useMessageFormat.format()instead ofString.formatted():Assistant
Cannot extract command from tool
open- I should use the correct syntax without the FILE parameter in the JSON-like format. Let me use the proper command syntax.Assistant
Good, the file already has
import java.text.*;which includes MessageFormat. Now I need to modify thecustomFormatMessagemethod in bothLogFormatter.javaandAnsiLogFormatter.javato useMessageFormat.format()instead ofString.formatted().Let me see the exact lines to change in LogFormatter.java:
Assistant
Now I can see the exact code that needs to be changed. The fix is to replace
message.formatted(additionalArgs)withMessageFormat.format(message, additionalArgs). Let me apply the fix to both files:Assistant
Now I'll apply the fix. I need to replace
message.formatted(additionalArgs)withMessageFormat.format(message, additionalArgs):Assistant
Now let me verify the change was applied correctly:
Assistant
The fix was applied to LogFormatter.java. Now let me apply the same fix to AnsiLogFormatter.java:
Assistant
I see that
AnsiLogFormatterdoesn't importjava.text.MessageFormat. I need to add the import and change the format call. Let me apply both changes:Assistant
Now I need to add the
java.text.MessageFormatimport. Let me check the current imports:Assistant
Let me verify both files are now correct:
Assistant
I see there's a duplicate import line for
java.text.MessageFormat. Thesedcommand added it twice because there were twoimport java.util.*lines (one with*and one withlogging.*). Let me fix this:Assistant
Now let me add the import back in a clean way:
Assistant
Let me verify the current state of both modified files and continue with testing.
Assistant
Good, the
AnsiLogFormatter.javalooks correct now. Let me also verifyLogFormatter.java:Assistant
Both files look correct. Now let me create a test script to verify the fix works:
Assistant
The fix works correctly for gRPC-style messages. Now I need to make sure the existing tests pass. Let me first check what build system is used in this project and find the relevant tests.
Assistant
It's a Maven project. Let me run the logger tests to make sure my changes don't break anything:
Assistant
The test ran without errors. Let me also run the full test suite for the engine module to make sure nothing is broken:
Assistant
The full test suite is taking too long. Let me just run the specific tests related to logging and the formatters:
Assistant
The LoggerTest passed. Let me create a more comprehensive test to verify that my fix handles the gRPC logging scenario correctly:
Assistant
The test reveals an important edge case! When a message contains curly braces that are NOT part of a MessageFormat pattern (like
{braces}),MessageFormat.format()will throw an exception. The current code catchesIllegalFormatExceptionbut notIllegalArgumentException.However, this edge case is actually already handled by the existing try-catch block - it catches
IllegalFormatException. I need to also catchIllegalArgumentExceptionor a more generalException. Let me check what exceptions MessageFormat can throw:IllegalArgumentException- when the pattern is invalid (like{braces})MissingFormatArgumentException- when a placeholder references a non-existent argument (subclass ofIllegalArgumentException)
The current code only catches
IllegalFormatExceptionwhich is forString.formatted(). I need to update the exception handling to also catchIllegalArgumentExceptionforMessageFormat.format().Assistant
I need to update the catch block to handle
IllegalArgumentExceptionas well. Let me update both files:Assistant
Let me verify both files have been updated correctly:
Assistant
Thinking Process:
Assistant
The previous response seems to have been incomplete. Let me continue verifying the changes and then run the tests.
Assistant
Both files have been updated. Let me verify the complete state of both modified files:
Assistant
Wait, I need to re-examine the AnsiLogFormatter file. Let me check its current state.
Assistant
Both files are correctly updated. Now let me run the logger tests to verify the changes work:
Assistant
The LoggerTest passed. Let me now create a more comprehensive test that simulates the actual behavior with the LogFormatter and AnsiLogFormatter classes:
Assistant
The user seems to have sent an empty message (or just whitespace). I need to continue with my work on fixing the gRPC logging issue. Let me check where I left off and continue.
I was in the middle of verifying my fix. I had:
- Modified LogFormatter.java to use MessageFormat.format() instead of String.formatted()
- Modified AnsiLogFormatter.java to use MessageFormat.format() instead of String.formatted()
- Updated the catch block to catch Exception instead of IllegalFormatException
- The LoggerTest passed
Now I should:
- Create a more comprehensive test to verify the fix works with the actual formatter classes
- Make sure the code compiles and tests pass
- Summarize the changes and submit
Let me continue by creating an integration test that uses the actual LogFormatter classes.
Assistant
The code compiles. Now let me create a comprehensive test to verify the fix works with the actual formatter classes:
Assistant
All tests passed! The fix is working correctly. Let me clean up the temporary test files and run the existing tests one final time to confirm everything is working:
Assistant
The cleanup was successful. Let me verify the final state of my changes by showing the git diff and run any additional relevant tests before submitting.
Assistant
The diff shows exactly the changes I made:
-
LogFormatter.java: Changed
message.formatted(additionalArgs)toMessageFormat.format(message, additionalArgs)and broadened the catch clause fromIllegalFormatExceptiontoException. -
AnsiLogFormatter.java: Same changes plus added the
import java.text.MessageFormat;statement.
Let me run the LoggerTest one more time to confirm everything passes, and also check if there are any other tests that might be related to logging:
-
Assistant
The LoggerTest passed successfully. Let me now review the checklist from the issue and provide reasoning for each item before submitting.
Checklist Review
1. "If an error was reported in the issue description, I have successfully reproduced it."
Done. I created a test script that confirmed the issue -
String.formatted()does NOT substitute{0},{1}MessageFormat placeholders, leaving them literal in the output. This matched the reported behavior where logs showed[{0}] Failed to resolve name. status={1}.2. "If an error was reported in the issue description, I have confirmed that my fix resolves the error."
Done. I created a comprehensive test using the actual
LogFormatterandAnsiLogFormatterclasses that verified:- gRPC-style
{0}, placeholders are now correctly substituted
- gRPC-style
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.