Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Worker.Grpc logs currently use the overly broad Microsoft.DurableTask category, making them hard to filter without affecting other components. This introduces more specific categories while maintaining backward compatibility through dual-emission.

Changes

New logging category structure:

  • Worker.Grpc: Microsoft.DurableTask.Worker.Grpc (previously Microsoft.DurableTask)
  • Follows pattern: Microsoft.DurableTask.{Component}.{Subcomponent}

Backward compatibility via dual-emission:

  • Added DurableTaskWorkerOptions.Logging.UseLegacyCategories (default: true)
  • Implemented DualCategoryLogger that emits to both new and legacy categories when enabled
  • Existing log filters continue working without modification

Migration path:

services.AddDurableTaskWorker(options =>
{
    // Step 1: Update your log filters to use new categories
    // Step 2: Test with both categories emitting (default)
    // Step 3: Disable legacy when ready
    options.Logging.UseLegacyCategories = false;
});

Breaking Changes

Setting UseLegacyCategories = false stops emitting to Microsoft.DurableTask category. Log filters expecting this category will need updates. Default behavior is non-breaking.

Original prompt

This section details on the original issue you should resolve

<issue_title>Make logging categories more specific</issue_title>
<issue_description>The current logger category assignments are inconsistent and, in some cases, overly broad.

Example 1: There are logs related to work item processing under the Microsoft.DurableTask category, making them hard to filter out without also filtering out more useful logs under this prefix. There are event some gRPC logs under this category, whereas they should probably exist under Microsoft.DurableTask.*.Grpc.

These changes should be considered as breaking changes since users may have queries that check for specific logging categories (rather than prefixes).

</issue_description>

<agent_instructions>Introduce compatibility opt-in

做一个兼容层:

1️⃣ 新 category + legacy alias(temporary)

比如:

Microsoft.DurableTask.Worker.Xxx
Microsoft.DurableTask.Grpc.Yyy

但同时 emit legacy category:

Microsoft.DurableTask

这样:

新用户看到正确分类

老用户的 filter 不会失效

rollout 逐步进行

🌟 提供 migration guidance

可以:

在 release notes / upgrade guide 里明确写:

In version X.X we introduce more specific logging categories.
Legacy category events are still emitted until version Y.Y.

并给 migration 示例代码。

🌟 可配置 opt-out / opt-in

例如 DurableTaskWorkerOptions:

options.Logging.UseLegacyCategories = true;

默认开,然后未来一个 major release 去掉 legacy。</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

this.provider = provider;
}

public void AddProvider(ILoggerProvider provider)
Copilot AI changed the title [WIP] Make logging categories more specific and introduce compatibility opt-in Add specific logging categories with backward-compatible opt-in Dec 10, 2025
Copilot AI requested a review from YunchuWang December 10, 2025 19:06
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.

Make logging categories more specific

2 participants