Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feat/durable logger#6

Merged
maschnetwork merged 9 commits intomainfrom
feat/durable-logger
Jan 21, 2026
Merged

Feat/durable logger#6
maschnetwork merged 9 commits intomainfrom
feat/durable-logger

Conversation

@maschnetwork
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

#4

Description

  • Added DurableLogger for logging within a durable execution (Replay awareness and step context)
  • Added examples with logging and proper MDC log configuration
  • Cleaned up SDKs own internal logs and move verbose things to TRACE

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Yes

Integration Tests

Yes

Examples

Yes

@maschnetwork maschnetwork requested a review from phipag January 15, 2026 16:54
docs/design.md Outdated

`ExecutionManager` tracks whether we're replaying completed operations or executing new ones via `ExecutionMode`:

- **REPLAY**: Started with if `operations.size() > 1` (has checkpointed operations beyond the initial EXECUTION op)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this check cover all the scenarios? Python SDK has a method for the same purpose but the condition is much more complex than this https://github.com/aws/aws-durable-execution-sdk-python/blob/afd40835f66a4d2267d4397031cb115e6556f65c/src/aws_durable_execution_sdk_python/state.py#L293-L324

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just for setting the initial REPLAY state. We do have another method that checks for transitioning back to new in getOperationAndUpdateReplayState - similar how the Python SDK does it. But Python is also checking for Status - which TS is not doing: https://github.com/aws/aws-durable-execution-sdk-js/blob/155c5b88e4419b554039b5869666815d731ba7e6/packages/aws-durable-execution-sdk-js/src/context/durable-context/durable-context.ts#L209

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to include terminal state. Please take a look @zhongkechen

Copy link
Contributor

@phipag phipag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @maschnetwork. Just left a few smaller comments below.

It is not clear to me when we use .trace() vs. .debug() now in our library code.

@maschnetwork
Copy link
Contributor Author

Awesome work @maschnetwork. Just left a few smaller comments below.

It is not clear to me when we use .trace() vs. .debug() now in our library code.

Addressed review comments in latest commit.

@maschnetwork
Copy link
Contributor Author

@phipag and @zhongkechen updated the PR to:

  • Use MDC directly instead of a custom ThreadLocal, improving performance by setting context once per operation rather than per log call. This is still depending on the context creation being moved to handler thread - otherwise MDC would be set on the main thread and not logged for non-step threads
  • Replay mode now transitions to execution mode when encountering non-terminal operations (not just missing ones)

Copy link
Contributor

@phipag phipag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I like the way we were able to simplify!

@phipag
Copy link
Contributor

phipag commented Jan 20, 2026

A general comment: Should we consider updating all example to use DurableLogger by default with a nice log4j2.xml JSON logging config? The logging example does not add a lot of value because logging is a cross-cutting concern across the whole code base.

@maschnetwork
Copy link
Contributor Author

A general comment: Should we consider updating all example to use DurableLogger by default with a nice log4j2.xml JSON logging config? The logging example does not add a lot of value because logging is a cross-cutting concern across the whole code base.

Yes but lets update the samples in a separate PR and also once your thread naming is merged.

Please check if there are any remaining issues from your side before merging.

Copy link
Contributor

@phipag phipag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final changes. Everything else looks good!

Copy link
Contributor

@phipag phipag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 🥳

@maschnetwork maschnetwork merged commit b95c5bf into main Jan 21, 2026
2 checks passed
@maschnetwork maschnetwork deleted the feat/durable-logger branch January 21, 2026 12:33
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.

3 participants