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
In this release we are excited to announce the release of custom log formatter support. You can customize the structure (keys and values) of your log entries by implementing a custom log formatter and override default log formatter using Logger.UseFormatter method. You can implement a custom log formatter by inheriting the ILogFormatter class and implementing the object FormatLogEntry(LogEntry logEntry) method.
We are also happy to announce the support for adding the Idempotent attribute on any method, not only the Lambda handler.
We also made improvements to how we handle when an exception is thrown inside a method that is decorated with Powertools utilities the user should see the full stack trace for that exception.
We also removed Moq library from our tests and replaced it with NSubsitute due to privacy concerns
Custom log formatter
Create a class that implements ILogFormatter
Call method Logger.UseFormatter on Lambda function constructor
Example CloudWatch Logs
Idempotent attribute on another method
You can use the Idempotent attribute for any .NET function, not only the Lambda handlers.
When using Idempotent attribute on another method, you must tell which parameter in the method signature has the data we should use:
If the method only has one parameter, it will be used by default.
If there are 2 or more parameters, you must set the IdempotencyKey attribute on the parameter to use.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
In this release we are excited to announce the release of custom log formatter support. You can customize the structure (keys and values) of your log entries by implementing a custom log formatter and override default log formatter using
Logger.UseFormatter
method. You can implement a custom log formatter by inheriting theILogFormatter
class and implementing the objectFormatLogEntry(LogEntry logEntry)
method.We are also happy to announce the support for adding the Idempotent attribute on any method, not only the Lambda handler.
We also made improvements to how we handle when an exception is thrown inside a method that is decorated with Powertools utilities the user should see the full stack trace for that exception.
We also removed Moq library from our tests and replaced it with NSubsitute due to privacy concerns
Custom log formatter
Create a class that implements
ILogFormatter
Call method
Logger.UseFormatter
on Lambda function constructorExample CloudWatch Logs
Idempotent attribute on another method
You can use the Idempotent attribute for any .NET function, not only the Lambda handlers.
When using Idempotent attribute on another method, you must tell which parameter in the method signature has the data we should use:
Full list of changes
🌟New features and non-breaking changes
📜 Documentation updates
🐛 Bug and hot fixes
🔧 Maintenance
This release was made possible by the following contributors:
@amirkaws, @hjgraca and @hossambarakat
This discussion was created from the release 1.4.2.
Beta Was this translation helpful? Give feedback.
All reactions