We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using the AppSettings(prefix) overload, Serilog neither fails nor complains in the SelfLog about not finding any appSettings with that prefix.
AppSettings(prefix)
SelfLog
Create a project with no serilog related settings in web.config/app.config.
Setup SelfLog:
Serilog.Debugging.SelfLog.Enable(Console.Error); // Or some other destination of choice
Create a logger with any prefix:
var logger = new LoggerConfiguration() .ReadFrom.AppSettings("MyLoggerA") .CreateLogger(); logger.Information("Some log message");
Notice there's nothing written to Console.Error.
Console.Error
I can't figure out if that's by design or not, but it seems unintuitive, that this should silently go through without at least a warning in SelfLog.
If I instead add settings like:
<add key="MyLoggerA:serilog:using:File" value="Serilog.Sinks.File" /> <add key="MyLoggerA:serilog:write-to:File.path" value="Q:\Logs\Foged\Server\ApplicationLog.txt" />
It complains in SelfLog as I don't have a Q: drive.
Q:
The text was updated successfully, but these errors were encountered:
Hi! This is by design - the absence of any settings for Serilog just means that there's no settings to apply.
It's quite a common pattern to configure baseline sinks etc. in code, but to add additional sinks in some environments via configuration files.
In the environments with no additional sinks, nothing goes into the config file. Because of this I don't think we'd emit a warning here.
Sorry, something went wrong.
No branches or pull requests
When using the
AppSettings(prefix)
overload, Serilog neither fails nor complains in theSelfLog
about not finding any appSettings with that prefix.How to reproduce
Create a project with no serilog related settings in web.config/app.config.
Setup SelfLog:
Create a logger with any prefix:
Notice there's nothing written to
Console.Error
.I can't figure out if that's by design or not, but it seems unintuitive, that this should silently go through without at least a warning in
SelfLog
.If I instead add settings like:
It complains in
SelfLog
as I don't have aQ:
drive.The text was updated successfully, but these errors were encountered: