Skip to content

Included original exception when failed to write to local log file#336

Merged
normj merged 2 commits intodevfrom
normj/fix-crash-file
Oct 7, 2025
Merged

Included original exception when failed to write to local log file#336
normj merged 2 commits intodevfrom
normj/fix-crash-file

Conversation

@normj
Copy link
Copy Markdown
Member

@normj normj commented Oct 6, 2025

Issue #, if available:
#329

Description of changes:
When there is a misconfiguration or connection issue sending request to CloudWatch Logs the library will write to a local log file to allow users to understand something went wrong with the exception of what happen. If you are in Lambda or some other read only file system the library then fails to write to the local file. Before this patch it would write to the console the exception for why it couldn't write to the local file. This PR adds to the console write to also include the original exception that triggered the need to ever write to the local log file.

I also updated to latest AWS SDK for .NET versions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@normj normj force-pushed the normj/fix-crash-file branch 2 times, most recently from 22a92b8 to 8dd519a Compare October 6, 2025 17:42
@GarrettBeatty GarrettBeatty requested a review from Copilot October 6, 2025 18:24
@GarrettBeatty
Copy link
Copy Markdown
Contributor

should target dev branch

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves error handling when the AWS logging library fails to write to a local log file by including the original exception in the console output. Additionally, it updates AWS SDK dependencies to their latest versions.

  • Enhanced error reporting to include the original exception when local file logging fails
  • Updated AWS SDK dependencies (CloudWatchLogs, SecurityToken, Core) to newer versions
  • Replaced deprecated User-Agent header manipulation with proper SDK API usage

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/AWS.Logger.Core/Core/AWSLoggerCore.cs Enhanced exception handling and updated User-Agent implementation
src/AWS.Logger.Core/AWS.Logger.Core.csproj Updated AWSSDK.CloudWatchLogs to version 4.0.8.4
Multiple test project files Updated AWSSDK.SecurityToken to version 4.0.2.6
Sample project files Updated AWSSDK.Core to version 4.0.0.32
.autover/changes/*.json Added changelog entries for the patch release

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/AWS.Logger.Core/Core/AWSLoggerCore.cs
"Type": "Patch",
"ChangelogMessages": [
"When failed to write to local log file write the original exception that triggered the reason for writing to the local log file to the console",
"Updated AWSSDK.CloudWatchLogs dependency to version AWS 4.0.8.4"
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

Corrected changelog message to remove extra 'AWS' prefix in version description.

Suggested change
"Updated AWSSDK.CloudWatchLogs dependency to version AWS 4.0.8.4"
"Updated AWSSDK.CloudWatchLogs dependency to version 4.0.8.4"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

@normj normj changed the base branch from main to dev October 6, 2025 18:45
…hat triggered the reason for writing to the local log file to the console

Updated AWSSDK.CloudWatchLogs dependency to version AWS 4.0.8.4
@normj normj force-pushed the normj/fix-crash-file branch from 8dd519a to 161dd08 Compare October 6, 2025 18:47
@normj
Copy link
Copy Markdown
Member Author

normj commented Oct 6, 2025

should target dev branch

Done, although I picked up a commit in main that wasn't synced with dev. I figure when I merge I won't do a squash merge to keep the commit as is when going into dev.

@normj normj merged commit 4a06266 into dev Oct 7, 2025
8 checks passed
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.

6 participants