-
Notifications
You must be signed in to change notification settings - Fork 1
Structured Logging and Debugging Option #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
johha
merged 15 commits into
cloudfoundry:main
from
sap-contributions:feature/log-to-file
Jan 20, 2026
Merged
Structured Logging and Debugging Option #22
johha
merged 15 commits into
cloudfoundry:main
from
sap-contributions:feature/log-to-file
Jan 20, 2026
Conversation
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
- slog added with some configuration, seting up debug level, writes to file if provided - debug flag added to run in debug mode, this will run clients in debug mode to see all request/responses
- A middleware for logging request/responses for gcs client added - a new config for general purpose introduced. It is a singletion and can be accessed in anywhere. Debug flag added into it, it can be extented further with some other config parameters.
- log lines in main and gcs client replaced with slog - log-level added instead of debug option - slog info option injected into RunGCSCLI to print some logs which are being used in some test casses
- all logs converted to slog - log messages improved - failing test cases due to the new messges are adapted
- log replaced with slog - debug mode for the ali client is added - log messages are refactored - integration tests refactored to be compatible with log messages if required - runcli for integratio tests is run with info level to grap log messages
3e7ee49 to
71f6515
Compare
johha
approved these changes
Jan 20, 2026
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.
Context
The existing logging implementation relied on legacy, unstructured log output written exclusively to
stderr. There was no consistent use of log levels across the codebase, which made it difficult to control verbosity and distinguish between informational, warning, and error messages.Due to the lack of structured logging, log output could not be reliably scraped or indexed by centralized logging systems such as ELK. Additionally, there was no option to persist logs to a file, and no proper debugging capability to capture full request/response flows for external service calls.
Solution
Changes Introduced
slogwith a JSON handler, enabling structured, key–value based logs suitable for log aggregation and analysis pipelines.debug,info,warn, anderror.--log-levelflag to control runtime verbosity.warnto avoid excessive logging in normal operation.--log-fileflag to optionally stream logs to a file.stderrwhen no file is specified.--log-level=debugis enabled, both clients capture and log full request/response pairs to support deep debugging and troubleshooting.AZURE_SDK_GO_LOGGING="all"for request/response tracing (see: https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore/log).slog, ensuring consistency with the structured logging approach used across the codebase.(https://github.com/cloudfoundry/bosh-s3cli).