Skip to content
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

Document ctx.console #310

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/services/sdk/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ Default behavior is (when `RESTATE_DEBUG_LOGGING` is not set)
- When `NODE_ENV=production`, the log setting is `OFF`
- Otherwise, the `INVOKE` setting is used.

**Console logging**
If you use the default Node console logger, log statements will be printed over and over again during replays.
To avoid this, you can use the Restate context logger, which is a wrapper around the console logger that suppresses duplicate log statements during replays:

```typescript
ctx.console.info("This will not be printed again during replays");
ctx.console.debug("This will not be printed again during replays");
// Any other console logging method can be used
```

</TabItem>

<TabItem value="java" label="Java" default>
Expand Down
Loading