feat: support structured logging#277
Open
adubovik wants to merge 5 commits into
Open
Conversation
Migrate to aidial-sdk 0.38.0, which provides configure_root_logger/ LogConfig for uniform log formatting and JSON structured logging (DIAL_SDK_LOG_FORMAT=json), replacing the hand-rolled root logger setup. The app's request-prefix log filter is preserved on top of the SDK-installed handler. Analogous to epam/ai-dial-adapter-bedrock#466 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Allob
reviewed
Jul 17, 2026
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
adubovik
force-pushed
the
feat/structured-logging
branch
from
July 17, 2026 16:13
5957111 to
71fb561
Compare
The custom text_format only reordered process/name vs. the SDK's own default, so just let configure_root_logger() use its defaults. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Re-apply the custom text_format to configure_root_logger() so the repo's original log field order is preserved instead of switching to the SDK's default order. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Allob
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates to
aidial-sdk0.38.0 and switches to the SDK's built-in logging configuration (LogConfig/configure_root_logger), which adds support for structured JSON logging alongside the existing text format. The service's request-prefix log filter is preserved on top of the SDK-installed handler.The way to enable the JSON logs:
DIAL_SDK_LOG_FORMAT=json DIAL_SDK_JSON_LOG_FORMAT='{"level": "%(levelname)s", "time": "%(asctime)s", "logger": "%(name)s", "process": "%(process)d", "message": "%(message)s"}'Where
DIAL_SDK_JSON_LOG_FORMATis optional with a reasonable default.More details in the SDK logging doc.
This is analogous to epam/ai-dial-adapter-bedrock#466, which made the same change in the Bedrock adapter.
Test plan
poetry run nox -s lintpassespoetry run nox -s testspasses (134 passed)