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

Adding support for scopes #85

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

spasarto
Copy link

Adding support for externally stored scopes & category.

Implementation based on existing BatchingLogger: https://github.com/aspnet/Extensions/blob/master/src/Logging/Logging.AzureAppServices/src/BatchingLogger.cs

SumoLogic.Logging.AspNetCore/LoggerOptions.cs Outdated Show resolved Hide resolved
SumoLogic.Logging.AspNetCore/LoggerProvider.cs Outdated Show resolved Hide resolved
}


builder.AppendLine(message.Trim());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we changing the default logic from

String line = string.Concat(
                message.TrimEnd(Environment.NewLine.ToCharArray()),
                Environment.NewLine);

to just
message.Trim()?

Copy link
Author

Choose a reason for hiding this comment

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

I'm trying to remember my exact reason - it's been a while :)

The changes were based off of the ConsoleLogger implementation of scopes:
https://github.com/aspnet/Extensions/blob/master/src/Logging/Logging.Console/src/ConsoleLogger.cs

Specifically, they replace all new lines in message, not just the beginning and end. I know I encountered a need for this during testing, but I can't remember the case anymore.

What are your concerns in regards to trimming the start?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am unsure on why the initial code was written like that. There might have been a reason too! :) So I am just worried about touching something which we are not completely aware of. And if we can't justify this change right now, I'll prefer to revert this change. We can obviously add this change later on in some other PR, if needed.

SumoLogic.Logging.AspNetCore/LoggerProvider.cs Outdated Show resolved Hide resolved
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.

3 participants