Skip to content

Conversation

@gontzess
Copy link
Contributor

Description

passing the logger as a field on the client fixes the lamdba outputs, but needs further investigation. are we not passing ctx properly in the sdk?

Screenshot 2025-07-25 at 22 15 54

Useful links:

return &Client{
httpClient: httpClient,
httpClient: wrapper,
logger: logger,
Copy link
Contributor

Choose a reason for hiding this comment

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

I strongly recommend using ctxzap.Extract(ctx) to get the logger. Otherwise it makes things like logger.With(...) cumbersome:

logger := c.logger.With("name", zap.String(val))

logger.Debug(...)

If anyone uses c.logger.Debug() instead of logger.Debug(), the fields specified in .With(...) won't be logged. Also if anyone modifies c.logger, it will change logging in other functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this all makes sense! i was testing a few different things, and so verifying this less-than-ideal workaround allowed me to see logs from client.go was helpful information at the time, leading me to believe we weren't passing the context properly in lambdas. looks like @kans and @laurenleach identified and fixed the ctx issue in the sdk last week 🥳
ConductorOne/baton-sdk#413

@gontzess gontzess closed this Aug 4, 2025
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