Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .autover/changes/52c0e0b8-9e89-458c-8ee1-07433da667d9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"Projects": [
{
"Name": "AWS.Logger.Core",
"Type": "Patch",
"ChangelogMessages": [
"Fixed issue with logging suffix in user agent being duplicated till the user agent is too big and requests stop working"
]
},
{
"Name": "AWS.Logger.AspNetCore",
"Type": "Patch",
"ChangelogMessages": [
"Update to latest version of AWS.Logger.Core"
]
},
{
"Name": "AWS.Logger.Log4net",
"Type": "Patch",
"ChangelogMessages": [
"Update to latest version of AWS.Logger.Core"
]
},
{
"Name": "AWS.Logger.SeriLog",
"Type": "Patch",
"ChangelogMessages": [
"Update to latest version of AWS.Logger.Core"
]
},
{
"Name": "NLog.AWS.Logger",
"Type": "Patch",
"ChangelogMessages": [
"Update to latest version of AWS.Logger.Core"
]
}
]
}
12 changes: 6 additions & 6 deletions src/AWS.Logger.Core/Core/AWSLoggerCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public AWSLoggerCore(AWSLoggerConfig config, string logType)
var client = new AmazonCloudWatchLogsClient(credentials, awsConfig);

client.BeforeRequestEvent += ServiceClientBeforeRequestEvent;
client.ExceptionEvent += ServiceClienExceptionEvent;
client.ExceptionEvent += ServiceClientExceptionEvent;
Copy link
Member Author

Choose a reason for hiding this comment

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

This change wasn't relevant to the issue, just fixing a typo in the private method name.


return client;
});
Expand Down Expand Up @@ -678,13 +678,13 @@ void ServiceClientBeforeRequestEvent(object sender, RequestEventArgs e)
{
var userAgentString = $"{_baseUserAgentString} ft/{_logType}";
var args = e as Amazon.Runtime.WebServiceRequestEventArgs;
if (args == null)
return;

((Amazon.Runtime.Internal.IAmazonWebServiceRequest)args.Request).UserAgentDetails.AddUserAgentComponent(userAgentString);
if (args != null && args.Request is Amazon.Runtime.Internal.IAmazonWebServiceRequest internalRequest && !internalRequest.UserAgentDetails.GetCustomUserAgentComponents().Contains(userAgentString))
{
internalRequest.UserAgentDetails.AddUserAgentComponent(userAgentString);
}
}

void ServiceClienExceptionEvent(object sender, ExceptionEventArgs e)
void ServiceClientExceptionEvent(object sender, ExceptionEventArgs e)
{
var eventArgs = e as WebServiceExceptionEventArgs;
if (eventArgs?.Exception != null)
Expand Down