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

Support AuditTo in configuration #87

Merged
merged 7 commits into from
Feb 10, 2018
Merged

Conversation

tsimbalar
Copy link
Member

Fixes #80

  • handles AuditTo
  • adds more general tests with sample json config snippets
  • update Serilog reference to v2.5.à

@tsimbalar
Copy link
Member Author

I don't know if it's worth incrementing the minor version -> v2.5.0 ... because of new feature, and also to align it with the version of Serilog that is referenced

@@ -260,6 +271,13 @@ internal static IList<MethodInfo> FindSinkConfigurationMethods(IEnumerable<Assem
return found;
}

internal static IList<MethodInfo> FindAuditSinkConfigurationMethods(IEnumerable<Assembly> configurationAssemblies)
{
var found = FindConfigurationMethods(configurationAssemblies, typeof(LoggerAuditSinkConfiguration));
Copy link
Member Author

Choose a reason for hiding this comment

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

All the other methods somehow used found.Add(GetSurrogateConfigurationMethod<T> , but I was not sure whether that was needed for Audit ..

Copy link
Contributor

@skomis-mm skomis-mm Feb 9, 2018

Choose a reason for hiding this comment

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

@tsimbalar GetSurrogateConfigurationMethod<T> is for methods mimicking static methods (extensions) and used just to get MethodInfo using expressions without reflection, but implementation I did is overcomplicated and just realized you can get MehtodInfo right out of method group after casting to appropriate delegate type:
((Func<LoggerFilterConfiguration, ILogEventFilter, LoggerConfiguration>)With).MethodInfo

Copy link
Member Author

Choose a reason for hiding this comment

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

oh I see. I guess it might not be necessary for AuditTo

Copy link
Member

Choose a reason for hiding this comment

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

I think it'd be needed for AuditTo.Logger() .. but this seems like a bit of a fringe case.

@nblumhardt
Copy link
Member

Thanks for the huge push on all of these things! I notice you're back from vacation :-)

I think updating the minor version is reasonable - though probably not a huge deal for downstream consumers.

Perhaps, since we're bumping the Serilog dependency version, we should update it to 2.6 so that the more recent package is brought in by default when installing this one? Thoughts?

@tsimbalar
Copy link
Member Author

tsimbalar commented Feb 9, 2018

Ok I'll increase the version number and reference v2.6.

Thibaud DESODT added 2 commits February 9, 2018 07:25
and use https URLS in nuget package metadata
@skomis-mm
Copy link
Contributor

Looks great! 👍
(i'm a bit overwhelmed, but will keen to help as i can)

@tsimbalar
Copy link
Member Author

btw, you may have noticed, but most of the test code is copied/pasted from the core Serilog repo :)

@nblumhardt nblumhardt merged commit 6c1e28f into serilog:dev Feb 10, 2018
@tsimbalar tsimbalar deleted the auditto branch February 11, 2018 12:08
@tsimbalar
Copy link
Member Author

tsimbalar commented Feb 13, 2018

@nblumhardt @skomis-mm just a heads up, I think I may have messed up at some point, and added the xml element <Version> instead of updating the <VersionPrefix> in file Serilog.Settings.Configuration.csproj ... (becaue I updated the version number through VS's project properties UI)

I have added a commit to fix it afterwards (7d1f277) , but I think because of that change, a "non prerelease" nuget package has been published : https://www.nuget.org/packages/Serilog.Settings.Configuration/2.5.0 ...

So we now have a "non-prerelease" nuget package that has been produced from the dev branch instead of the master branch ... Not sure what's the fix for now ... Any idea ?

@skomis-mm
Copy link
Contributor

@tsimbalar I believe the only change should be is minor version bump (2.6) after LoggingLevelSwitch pr is merged since its adds new features. The published changes are minimal, tested, so there should be no problems.
We don't need to manage versioning since @nblumhardt handles this very well.

p.s. its nothing comparing how CsvHelper was evolved in last few months :)

@nblumhardt
Copy link
Member

@tsimbalar I think the package out there as 2.5.0 is probably fine to leave, since it's been downloaded and used. Let's do as @skomis-mm suggests and bump the prefix to 2.6.0, which we can send through to master shortly after.

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