Skip to content

Enable auditing #12

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

Merged
merged 1 commit into from
Aug 17, 2016
Merged

Enable auditing #12

merged 1 commit into from
Aug 17, 2016

Conversation

nblumhardt
Copy link
Member

serilog/serilog#828

This makes AuditTo.File() work with Serilog 2.2-*.


FileSink sink;
try
{
sink = new FileSink(path, formatter, fileSizeLimitBytes, buffered: buffered);
}
catch (ArgumentException)
Copy link
Member Author

Choose a reason for hiding this comment

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

The precondition checks have always thrown in File(); this PR changes what throws/what doesn't very slightly, in that invalid path errors are now always suppressed in WriteTo scenarios and always propagate with AuditTo.

In general it's really hard to pin down which argument errors should be throwing ones. Serilog aims to always propagate API usage errors, and always (by default) suppress environmental/transient/runtime errors. In the case of the System.IO APIs and various configuration providers the line is fuzzy at times.

@nblumhardt
Copy link
Member Author

Merging so that the downstream items (XML and JSON support) can be kicked off :-)

@nblumhardt nblumhardt merged commit e590280 into serilog:dev Aug 17, 2016
@nblumhardt nblumhardt mentioned this pull request Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant