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 to understand the structure and locate relevant logging code. Let's first get an overview.
- Assistant
Let me explore the repository structure to understand the project better.
- Assistant
Let me understand the project structure better and look for gRPC related code and logging configuration.
- Assistant
Let me look at the gRPC related files and logging configuration.
- Assistant
Let me look at the gRPC logging interceptor and the server startup code to understand how logging is currently configured.
- Assistant
Let me look at the GrpcServerPlugin and GrpcLoggingInterceptor to understand how logging is set up.
- Assistant
Let me look at the logging infrastructure first. I need to understand how ArcadeDB bridges java.util.logging to SLF4J.
- Assistant
Now let me look at the LogManager class to understand how logging is implemented.
- Assistant
Let me examine the LogManager class to understand how it bridges JUL to the ArcadeDB logging system.
- Assistant
Now let me look at the DefaultLogger to understand how logging is actually implemented.
- Assistant
Let me fix the command format.
- Assistant
Now I understand the logging architecture. Let me look at the
AnsiLogFormatterwhich is the custom formatter installed byDefaultLogger. - Assistant
Let me check the AnsiLogFormatter and LogFormatter to see how they handle log messages.
- Assistant
Let me look at the
LogFormatterbase class to understand better. - Assistant
Now I understand the issue. When gRPC's
ManagedChannelImpllogs a message usingjava.util.loggingwithMessageFormat-style placeholders like{0},{1}, theLogFormattertries to format withString.formatted()which uses%s,%dformat - NOT{0},{1}. The message is never formatted.Let me verify by looking at how gRPC actually logs these messages:
- Assistant
Now I understand the issue clearly. The gRPC library uses
java.util.loggingwithMessageFormat-style placeholders ({0},{1}), but theLogFormatterin ArcadeDB tries to format them withString.formatted()which uses%s-style formatting. The{0}pattern doesn't match, so it throwsIllegalFormatExceptionwhich is silently caught, and the raw message with unsubstituted placeholders is used.Let me create a reproduction script to verify this:
- Assistant
Let me also check if there are tests for the logging formatter:
- Assistant
Let me check the LoggerTest to understand how logging is tested:
- Assistant
Now I have a clear understanding of the issue. Let me trace the flow:
- gRPC's
ManagedChannelImpluses JUL directly withMessageFormat-style placeholders:logger.log(Level.WARNING, "[{0}] Failed to resolve name. status={1}", new Object[]{channelName, status}) - This creates a
LogRecordwithmessage = "[{0}]..."andparameters = [channelName, status] - In
LogFormatter.customFormatMessage(),iRecord.getMessage()returns the raw template"[{0}] Failed to resolve name. status={1}" - The code calls
message.formatted(additionalArgs)which usesString.format()-style formatting (%s,%d), NOTMessageFormat-style ({0},{1}) - Since
{0}and{1}are not validString.format()specifiers, they pass through unchanged - The exception catch silently discards any errors
The fix is to use
MessageFormat.format()when the message contains{N}-style placeholders, instead ofString.formatted().Let me implement the fix:
- gRPC's
- Assistant
Now I need to modify the
customFormatMessagemethod to useMessageFormat.format()when the message contains{N}-style placeholders. Let me implement the fix: - Assistant
Let me use the correct edit syntax:
- Assistant
Let me try using the
opencommand first to make sure the file is open, then useeditwithout specifying--file. - Assistant
Let me use sed to make the changes since the edit command seems to have issues with special characters:
- Assistant
Let me apply the fix using sed. The key change is to add a
formatMessageWithParametersmethod that detectsMessageFormat-style placeholders ({0},{1}, etc.) and usesMessageFormat.format()instead ofString.formatted(): - Assistant
Let me check the file now and then replace the formatting block.
- Assistant
Now I need to add the
formatLogMessagehelper method toLogFormatter. Let me add it before thegetSourceClassSimpleNamemethod. - Assistant
Let me verify the file looks correct:
- Assistant
The sed operations didn't produce clean results. Let me rewrite the file properly:
- Assistant
Now let me verify the file looks correct:
- Assistant
Good. Now I need to also update
AnsiLogFormatterto use the same approach. Let me check it: - Assistant
I need to update
AnsiLogFormatteras well since it overridescustomFormatMessageand has the same issue. Let me fix it: - Assistant
Let me verify both files are correct:
- Assistant
Both files look correct. Let me also double-check the LogFormatter file hasn't been overwritten:
- Assistant
Good, both files look correct. Now let me think about the regex pattern. Let me write a quick test to verify the fix works correctly:
- Assistant
All tests pass. Now let me also write a test that simulates the actual gRPC LogRecord scenario to confirm the fix works end-to-end:
- Assistant
The test confirms the fix works perfectly:
- OLD behavior:
[{0}] Failed to resolve name. status={1}— unsubstituted placeholders (the bug) - NEW behavior:
[channel-7] Failed to resolve name. status=UNAVAILABLE: Unable to resolve host vcc-superx-arcadedb-2— properly substituted
Let me now also verify that the regex pattern correctly handles edge cases. Let me check one more edge case with the regex:
- OLD behavior:
- Assistant
Let me also test one more edge case —
{0}at the end of a string (no trailing whitespace, comma, or}): - Assistant
Wait,
{0}has}after the digit, so it correctly matches. Let me fix my test expectations: - Assistant
The regex works correctly. Let me add a defensive try/catch in
formatLogMessageto handle any edge case whereMessageFormat.format()might throw for malformed patterns: - Assistant
Let me verify the final state of both files:
- Assistant
Now let me check the AnsiLogFormatter file:
- Assistant
Both files look correct. Now let me try to compile the project to make sure the changes don't break anything:
- Assistant
Let me check if Maven is available and try to compile just the engine module:
- Assistant
Let me try a different approach.
- Assistant
Engine module compiles. Now let me also compile the modules that depend on these formatters:
- Assistant
Dependencies need to be built first. Let me try installing all dependencies first, then compile grpcw.
- Assistant
All dependencies compile. Now let me run the existing tests for the engine module:
- Assistant
Tests passed. Let me also run the gRPC-related tests to make sure nothing is broken there:
- Assistant
All tests pass. Let me check the diff of changes to make sure everything looks clean:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.