-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
Configurable logging #445
Comments
That's correct. The logger is currently not configurable. |
@danielpalme Would you welcome contributions to make it configurable? Maybe you already have a vision of how it should be done? |
Sorry, my initial reply was wrong or at least not complete. You can implement a custom Logger and custom LoggerFactory. Then you can register your custom factory: LoggerFactory.Configure(new MyCustomLoggerFactory()); That way you should be able to write a custom adapter to your logging system. |
Thanks, I'll give it a try. LoggerFactory.Configure(Action<VerbosityLevel, string> logDelegate); So that consumers would need to only provide a logger delegate instead of implementing their own If you're not against such an approach, I can draft a pull request. |
Sure, that should be no problem. |
I created a draft here: #446 |
Hello! Thanks for the great library.
I've been using it in my application for a while via nuget package
ReportGenerator.Core
, and now I wonder how to set up logging in a way that internal library logs are not printed to console, but instead redirected to the application-level logger (I'm using Serilog).Is there a way to configure that? From what I see from source code, class loggers are resolved once, and are stored in static fields, which will prevent runtime reconfiguration.
Am I missing something?
The text was updated successfully, but these errors were encountered: