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 the relevant logging bridge code. Let's first see what's in the root directory.
- Assistant
Let me look at the structure more broadly and find the logging-related files.
- Assistant
Let me find the logging bridge between JUL and SLF4J in the ArcadeDB codebase.
- Assistant
Let me search for the logging infrastructure and any JUL bridge.
- Assistant
Let me look at the logging infrastructure more carefully.
- Assistant
Let me look at the gRPC server module and find the logging bridge setup for JUL to SLF4J.
- Assistant
Let me look at the gRPC server plugin for the server-side logging.
- Assistant
Let me look at how gRPC logging is currently handled in the server, especially the DefaultLogger and the GrpcServerPlugin.
- Assistant
Now let me look at how gRPC is integrated and where the logging bridge is set up. The issue is about gRPC's
ManagedChannelImplusingjava.util.loggingwithMessageFormat-style placeholders like{0},{1}instead of SLF4J's{}style. Let me look at the GrpcServerPlugin and related files. - Assistant
Let me look at the GrpcLoggingInterceptor and search for how the JUL to ArcadeDB log bridge is done.
- Assistant
Let me look at the AnsiLogFormatter and the LogFormatter to understand how JUL messages are formatted.
- Assistant
Now let me look at the
LogFormatterto see if it handles the{0}style placeholders. - Assistant
Now I understand the issue. Let me look at the
LogFormatterandAnsiLogFormattermore carefully. The issue is that gRPC usesMessageFormat-style placeholders ({0},{1}) in its log messages, but the formatters useString.formatted()which expectsprintf-style%splaceholders. Let me check for existing tests. - Assistant
Now I understand the problem. The
LogFormatterandAnsiLogFormatteruseString.formatted()(which uses%s-style placeholders), but gRPC's JUL loggers useMessageFormat-style placeholders ({0},{1}). When parameters are present but the message uses{0}-style placeholders, theString.formatted()call fails silently (caught by theIllegalFormatExceptioncatch), and the raw template with unsubstituted{0}is output.Let me look at how the message flow works end-to-end:
- Assistant
No existing uses of MessageFormat. Let me understand the flow better.
The issue is: when gRPC's
ManagedChannelImpllogs using JUL withMessageFormat-style placeholders like , , the and in ArcadeDB don't substitute them properly. The code in does: - Assistant
Now I understand the issue clearly. The
LogFormatter.customFormatMessageandAnsiLogFormatter.customFormatMessageboth usemessage.formatted(additionalArgs)which isjava.util.Formatter-style formatting (%s,%d). However, gRPC's internal loggers usejava.text.MessageFormat-style placeholders ({0},{1}). When the message contains{0}and{1},message.formatted(additionalArgs)throws anIllegalFormatExceptionbecause the format string doesn't have any%splaceholders but the args array is non-empty. The exception is caught and the raw message with unsubstituted{0}and{1}is used.The fix is to also try
MessageFormat.format()whenString.formatted()fails. Let me implement this in bothLogFormatterandAnsiLogFormatter. - Assistant
Now let me understand the exact issue. The
LogFormatterandAnsiLogFormatterusemessage.formatted(additionalArgs)which usesString.format-style formatting (%s,%d), but gRPC'sManagedChannelImpllogs messages withjava.text.MessageFormat-style placeholders ({0},{1}). Whenmessage.formatted(additionalArgs)fails withIllegalFormatException, it's caught and the raw message with{0},{1}is output.The fix is to try
MessageFormat.format()as a fallback. Let me implement this: - Assistant
Let me try using the open command properly.
- Assistant
Now I can see the exact issue. In
LogFormatter.customFormatMessage()at line 88-89, whenadditionalArgsis not null, it callsmessage.formatted(additionalArgs)which usesString.format()style (%s,%d). But gRPC usesMessageFormatstyle ({0},{1}). TheString.formatted()call throwsMissingFormatArgumentException(a subclass ofIllegalFormatException) because there are no%sformat specifiers in the message string, so it falls through to the catch block and outputs the raw message with{0}and{1}.The fix: when
String.formatted()fails, tryMessageFormat.format()as a fallback, which substitutes{0},{1}, etc. with the corresponding arguments.Let me implement this fix in both
LogFormatter.javaandAnsiLogFormatter.java: - Assistant
Let me try the correct syntax:
- Assistant
Good, the
LogFormatteris updated. Now let me update theAnsiLogFormatteras well. - Assistant
I need to add the
java.text.MessageFormatimport toAnsiLogFormatter. Let me update it: - Assistant
Now let me verify the
LogFormatteralso has the properMessageFormatimport. Since it importsjava.text.*, that should includeMessageFormat: - Assistant
Good -
java.text.*is already imported inLogFormatter, soMessageFormatis available. And forAnsiLogFormatter, I used the fully qualified namejava.text.MessageFormat.format().Now let me create a test script to verify the fix works:
- Assistant
Interesting! On this Java version,
String.formatted()does NOT throwIllegalFormatExceptionwhen the message has{0}-style placeholders but no%sspecifiers. It just returns the original message unchanged (ignores extra args). This means the current catch block is never reached for{0}-style messages - the message is just output as-is without substitution. My initial fix won't work because the catch block is never reached.I need a different approach: detect
{0}-style placeholders and useMessageFormat.format()directly. Let me verify this: - Assistant
The approach works perfectly. Now I need to update my fix. Instead of relying on the catch block (which never fires), I should check upfront whether the message uses
{0}-style placeholders and useMessageFormat.format()directly. Let me update both files: - Assistant
Now I need to replace the current approach with the correct one that checks for
{0}-style placeholders upfront: - Assistant
Now let me replace the formatting logic to use the upfront detection approach:
- Assistant
Now let me update the formatting logic to properly detect and handle
{0}-style placeholders: - Assistant
Good. Now let me update the
AnsiLogFormattersimilarly: - Assistant
Now I need to update the AnsiLogFormatter. Since it extends LogFormatter, the MESSAGE_FORMAT_INDEXED_PLACEHOLDER pattern is inherited as a protected static field. Let me replace the formatting logic in AnsiLogFormatter.
- Assistant
Wait, I need to check if
MESSAGE_FORMAT_INDEXED_PLACEHOLDERis accessible fromAnsiLogFormatter. It's declared asprivate static finalinLogFormatter, so subclasses cannot access it. I need to change it toprotected static final. - Assistant
I need to change
private static final Pattern MESSAGE_FORMAT_INDEXED_PLACEHOLDERtoprotected static final Pattern MESSAGE_FORMAT_INDEXED_PLACEHOLDERso thatAnsiLogFormattercan access it. - Assistant
Good. Now let me also fix the missing blank line before the
@Overrideannotation on line 51: - Assistant
Now let me verify the final state of both files:
- Assistant
Now let me check the AnsiLogFormatter:
- Assistant
Both files look good. Let me now build the project to make sure it compiles. Let me check if there's a build system (Maven or Gradle).
- Assistant
Let me verify the code compiles. Let me try to build just the engine module:
- Assistant
The engine module compiles successfully. Now let me run the LoggerTest to make sure I haven't broken anything.
- Assistant
Good, no failures. Let me also write a quick verification script that simulates the gRPC logging behavior:
- Assistant
All tests pass. Now let me check if there's a
ConsoleLoggerthat might also have the same issue: - Assistant
The ConsoleLogger is separate and doesn't use JUL LogRecords - it's for importers/exporters. Let me also check the ServerLogManager:
- Assistant
The ServerLogManager is just a JUL LogManager subclass for controlling reset behavior. It doesn't have its own formatter. The fix is in the right place.
Let me also check the FixedGrpcLogAppender to make sure the fix covers all the paths:
- Assistant
The FixedGrpcLogAppender is a Ratis-specific subclass that uses ArcadeDB's LogManager directly with
%s-style - not relevant to the issue.Let me also check RemoteGrpcDatabase to see if there's a logging bridge there:
- Assistant
No special JUL bridge handler in RemoteGrpcDatabase. Let me also check if there's any JUL handler setup in the grpcw or grpc-client modules:
- Assistant
Good. The fix is in the right place. Let me now also check the
DefaultLoggerto make sure there's no issue there. Looking at theDefaultLogger, when it receives a message from ArcadeDB's own logging API, it already formats the message with%s-style before callinglog.log(level, msg)- so parameters are null in the LogRecord. But gRPC's JUL loggers calllogger.log(Level.WARNING, template, params)directly, which is where the issue occurs.Let me run the full test suite to make sure nothing is broken:
- Assistant
The full test suite timed out. Let me just run the LoggerTest which is most relevant to our changes:
- Assistant
LoggerTest passes (exit code 0). Let me also compile the server module to make sure everything works end-to-end:
- Assistant
Need to install the engine first. Let me do that:
- Assistant
Good. Let me now install the other dependencies and compile the server module:
- Assistant
The build seems to have dependency issues. Let me try building from the parent:
- Assistant
Let me now check the overall diff to make sure changes are clean:
- Assistant
The diff looks clean and correct. Let me verify the LoggerTest passes one more time:
- Assistant
Let me check what's happening:
- Assistant
All 4 LoggerTest tests pass with BUILD SUCCESS. Let me also check for any other tests that might be related:
- Assistant
Good. Only LoggerTest references those classes. Let me verify the final state of both files:
- Assistant
Now let me also verify the AnsiLogFormatter.
- Assistant
Both files look correct. Let me verify the build compiles one more time:
- Assistant
Let me also verify the fix works end-to-end by writing a quick test that directly tests the LogFormatter with gRPC-style parameters:
- Assistant
The fix works end-to-end. Let me also test the AnsiLogFormatter:
- Assistant
Both
LogFormatterandAnsiLogFormatternow correctly handleMessageFormat-style placeholders ({0},{1}) while still maintaining backward compatibility withprintf-style placeholders (%s).Let me clean up the temp files:
- Assistant
Now let me do a final review of the diff:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.