-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Plug in a real logger. #5
Comments
I'm planning to create So can can I make a PR , or shall I write a sample code to show you my humble design? |
/cc @Jetski5822 |
Argh, my comment didn't save. I think its a good idea to give it a go, have you seen the https://GitHub.com/aspnet/logging work? I'll comment more tomorrow as on phone at mo. |
Of course and I did a humble PRs, so shall I make a PR or write a code snippet first |
Lets take a look at a code snippet :) |
Sure 😄 |
So, create a LoggingModule : IModule, add add a Logger based on configuration. Then if we want to log to a file, its just configuration. Make the default NLog? Or console? Whatcha think? |
Of course the configuration is very handy in almost the providers: logging, authentication .. etc. The |
@Jetski5822 I faced some issues: |
Okay done! To plug in another logger we just need to create a module and implement the ILoggingInitiator interface. This will then get added to the Logger pipeline at the ApplicationServices level. i.e.
For NLog
|
* Add Orchard.Logging module adding NLog to pipeline * Revert "Add Orchard.Logging module adding NLog to pipeline" This reverts commit b1701fd. * Added stacktrace and tenant variable to NLog.config * Storing tenant name in httpcontext on Cms.Web project * Added aspnet-traceidentifier to nlog.config * Fixed middleware registration order * Replcing middleware per a LayoutRenderer * Remove unneeded middleware class
Merge for final round of Elastic Search
^ This is the 1st commit message: Add GetCulture() extension method ^ This is the commit message #2: Cleanup ISmsService (#15142) ^ This is the commit message #3: Fix TheAdminTheme layout margin and padding (#15143) ^ This is the commit message #4: Fix SectionDisplayDriver prefix (#15123) ^ This is the commit message #5: Prefill template name when creating a template. (#15145) ^ This is the commit message #6: Set the User Localization feature priority ^ This is the commit message #7: Fix issue with default culture not selected When currentUserCulture is null or supportedCulture doesn't contain currentUserCulture. ^ This is the commit message #8: Update the height of the admin content (#15153) ^ This is the commit message #9: Eliminate the anti-discovery pattern in Elasticsearch (#15134) ^ This is the commit message #10: Renaming and cleaning up search services (#15156) ^ This is the commit message #11: mkdocs-material 9.5.5
At the moment we have just a static console logger called FakeLogger. Lets get a real one in there and allow it to be easily swap-able.
The text was updated successfully, but these errors were encountered: