-
Notifications
You must be signed in to change notification settings - Fork 129
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
Updated from 2.5.0 to 2.6.0 broke my project. #91
Comments
Yeah, you cant even run the sample app now.
It appears the code thinks a level switch is required now. |
Thanks for the heads-up, Victorio. Taking a look now 👍 |
…) configuration method
Fix #91 - wrong parameter name on surrogate WriteTo.Logger configuration method
The issue here was a parameter name mismatch in the code that handles the 2.6.1 is now on NuGet with a fix (it may take up to an hour for NuGet to index it). @VictorioBerra if you can check that the new version works for you, that would be great. Leaving this open as the fix needs to come back into dev, and there's some minor tidying up to do after a hasty fix :-) |
@nblumhardt Your quick response time and fix is greatly appreciated. Thanks a lot! |
Thanks Victorio 👍 Just reopening briefly until we've finished bringing the changes back onto dev. |
Here are 2 tests that fail in dev (when added to class [Trait("Bugfix", "#91")]
[Fact]
public void WriteToLoggerWithRestrictedToMinimumLevelIsSupported()
{
var json = @"{
""Serilog"": {
""Using"": [""TestDummies""],
""WriteTo"": [{
""Name"": ""Logger"",
""Args"": {
""configureLogger"" : {
""WriteTo"": [{
""Name"": ""DummyRollingFile"",
""Args"": {""pathFormat"" : ""C:\\""}
}]},
""restrictedToMinimumLevel"": ""Warning""
}
}]
}
}";
var log = ConfigFromJson(json)
.CreateLogger();
DummyRollingFileSink.Emitted.Clear();
log.Write(Some.InformationEvent());
log.Write(Some.WarningEvent());
Assert.Equal(1, DummyRollingFileSink.Emitted.Count);
}
[Trait("Bugfix", "#91")]
[Fact]
public void WriteToLoggerWithLevelSwitchIsSupported()
{
var json = @"{
""Serilog"": {
""Using"": [""TestDummies""],
""LevelSwitches"": {""$subLoggerSwitch"" : ""Warning"" },
""WriteTo"": [{
""Name"": ""Logger"",
""Args"": {
""configureLogger"" : {
""WriteTo"": [{
""Name"": ""DummyRollingFile"",
""Args"": {""pathFormat"" : ""C:\\""}
}]},
""restrictedToMinimumLevel"": ""$subLoggerSwitch""
}
}]
}
}";
var log = ConfigFromJson(json)
.CreateLogger();
DummyRollingFileSink.Emitted.Clear();
log.Write(Some.InformationEvent());
log.Write(Some.WarningEvent());
Assert.Equal(1, DummyRollingFileSink.Emitted.Count);
} The second one still fails on |
Asp.Net Core
Error: System.InvalidOperationException: 'No LoggingLevelSwitch has been declared with name "Debug". You might be missing a section "LevelSwitches":{"Debug":"InitialLevel"}'
I dont see anywhere that I tell it to use a switch. Also, I dont see this on the README and I don't see it in the samples.
The text was updated successfully, but these errors were encountered: