Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh AWS.Logger.AspNetCore #90

Merged
merged 12 commits into from
Jun 26, 2019
Merged

Refresh AWS.Logger.AspNetCore #90

merged 12 commits into from
Jun 26, 2019

Conversation

normj
Copy link
Member

@normj normj commented Jun 26, 2019

Issue #, if available:
#45
#50
#52
#76

Also migrate the PR from Amazon.Lambda.Logging.AspNetCore
aws/aws-lambda-dotnet#471

Description of changes:
This a refresh of AWS.Logger.AspNetCore pulling in some work that has been done to Amazon.Lambda.Logging.AspNetCore and migrate the library to the newer interfaces of ASP.NET Core 2.1

List of feature updates:

  • Extension methods for ILoggingBuilder to register the provider
  • Improved scope support with support for Microsoft.Extensions.Logging.ISupportExternalScope
  • Improved default formatting of message to include event id, log level, category and exception
  • Ability to pull ProfileLocation from IConfiguration
  • Update ASP.NET Core samples and README.md

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

@Kralizek
Copy link

Oh wow! I love this PR! Thanks @normj

src/AWS.Logger.AspNetCore/AWSLogger.cs Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLogger.cs Outdated Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLogger.cs Outdated Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLogger.cs Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLogger.cs Outdated Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLogger.cs Outdated Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLoggerProvider.cs Outdated Show resolved Hide resolved
test/AWS.Logger.AspNetCore.Tests/TestClass.cs Outdated Show resolved Hide resolved
@@ -24,7 +24,7 @@ public void MakeSureCanCreateScope()
}

Assert.Single(coreLogger.ReceivedMessages);
Assert.True(coreLogger.ReceivedMessages.Contains("[Information] MakeSureCanCreateScope: log \r\n"), "Messages don't contain actual log message.");
Assert.True(coreLogger.ReceivedMessages.Contains("[Information] MakeSureCanCreateScope: log\r\n"), "Messages don't contain actual log message.");

Choose a reason for hiding this comment

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

These tests will fail if run on a platform where Environment.NewLine is not \r\n

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated tests to use Environment.NewLine constant.

Copy link

@matteo-prosperi matteo-prosperi left a comment

Choose a reason for hiding this comment

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

Approved when changing the NewLine handling in tests

src/AWS.Logger.AspNetCore/AWSLogger.cs Outdated Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLogger.cs Outdated Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLogger.cs Outdated Show resolved Hide resolved
src/AWS.Logger.AspNetCore/AWSLoggerConfigSection.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@costleya costleya left a comment

Choose a reason for hiding this comment

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

Anticipating test changes for newlines. Approval given in understanding.

@normj normj merged commit b808c53 into dev Jun 26, 2019
@normj normj deleted the aspnetcore-update branch June 26, 2019 22:28
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.

4 participants