Skip to content

NLog.AWS.Logger Error Handling Issue in AWS Lambda #329

@0Banana00

Description

@0Banana00

Describe the bug

When using NLog.AWS.Logger in an AWS Lambda environment, any errors encountered during logging are not reported effectively. The library attempts to write errors to a file, but since the file system in Lambda is read-only, this results in a failure to log the error details.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Errors should be logged or reported in a way that is accessible, even in a read-only environment.

Current Behavior

The only workaround is to set the property LibraryLogErrors="false", which prevents any logging of errors, making it impossible to diagnose issues.

Reproduction Steps

  1. Set up an AWS Lambda function using NLog.AWS.Logger.
  2. Introduce an error in the logging process.
  3. Observe that the error is not logged due to the attempt to write to a read-only file system.

Possible Solution

Consider implementing an alternative logging mechanism that captures errors in AWS Lambda without relying on file system access, or provide a way to output errors to the console or another logging service.

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

AWSSDK.Core 4.0.0

Targeted .NET Platform

.NET 6

Operating System and version

AWS Lambda

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.investigatingThis issue is being investigated and/or work is in progress to resolve the issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions