Skip to content

feat: add logging configuration support to Dapr SDK - #1805

Open
matheusandre1 wants to merge 1 commit into
dapr:masterfrom
matheusandre1:issue1282
Open

feat: add logging configuration support to Dapr SDK#1805
matheusandre1 wants to merge 1 commit into
dapr:masterfrom
matheusandre1:issue1282

Conversation

@matheusandre1

Copy link
Copy Markdown
Contributor

Description

Adds support for the spec.logging block of the Dapr Configuration resource in the testcontainers-dapr module, as described in https://docs.dapr.io/operations/configuration/configuration-overview/#logging.

  • Add LoggingConfigurationSettings and ApiLoggingConfigurationSettings (enabled, obfuscateURLs, omitHealthChecks)
  • Add a new Configuration constructor accepting LoggingConfigurationSettings (existing constructors are kept, so this is backward compatible)
  • Emit spec.logging.apiLogging in ConfigurationYamlConverter, omitting unset fields

Issue reference

Closes: #1282
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Example usage:

LoggingConfigurationSettings logging = new LoggingConfigurationSettings(
    new ApiLoggingConfigurationSettings(true, true, true)
);

new DaprContainer("daprio/daprd:1.16.0")
    .withAppName("dapr-app")
    .withConfiguration(new Configuration("my-config", null, null, null, logging));

Generated YAML:

apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
  name: my-config
spec:
  logging:
    apiLogging:
      enabled: true
      obfuscateURLs: true
      omitHealthChecks: true

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: Matheus André <matheusandr2@gmail.com>
@matheusandre1
matheusandre1 marked this pull request as ready for review September 9, 2026 13:19
@matheusandre1
matheusandre1 requested review from a team as code owners September 9, 2026 13:19
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.26%. Comparing base (9a7be01) to head (66ace60).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1805      +/-   ##
============================================
+ Coverage     78.17%   78.26%   +0.08%     
- Complexity     2427     2438      +11     
============================================
  Files           248      250       +2     
  Lines          7438     7467      +29     
  Branches        774      776       +2     
============================================
+ Hits           5815     5844      +29     
  Misses         1267     1267              
  Partials        356      356              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Configuration support for logging

1 participant