You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When the handlers returns any non-nil error, reportFailure is called and it does a raw log.Printf call, outputting a line in the standard go format like 2023/07/10 20:12:21 {"errorMessage":"error"}, breaking our logs handling which expects all logs to be JSON.
Describe the solution you'd like
Libraries should not output to stdout, at least a logger should be configurable.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered:
The error logging was added in #416 to help with behavioral compatibility when migrating from the the go1.x runtime to provided.al2 - so don't think we'd change the default. I would however be OK with adding an option to disable all logging by this library.
slog with v1.21 looks like it provides an option to change the behavior of the default log.Printf calls. Does this solve your output formatting problem? Or would you still find it useful to be able to entirely opt-out of any info logging done by aws-lambda-go?
SetDefault makes l the default Logger. After this call, output from the log package's default Logger (as with log.Print, etc.) will be logged at LevelInfo using l's Handler.
I think disabling all logs by default would be preferable, I don't expect that importing a library would output anything by default. Logging providers are very expensive with logs, we like to have complete control of them because this is a cost problem.
Is your feature request related to a problem? Please describe.
When the handlers returns any non-nil error,
reportFailure
is called and it does a raw log.Printf call, outputting a line in the standard go format like2023/07/10 20:12:21 {"errorMessage":"error"}
, breaking our logs handling which expects all logs to be JSON.Describe the solution you'd like
Libraries should not output to stdout, at least a logger should be configurable.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: