Comments (11)
I'm planning to create FileLoggerProvider
that we can subclasses and allow us to create a variety of file logger such as TextLoggerProvider
, XmlLoggerProvider
.. etc
So can can I make a PR , or shall I write a sample code to show you my humble design?
from orchardcore.
/cc @Jetski5822
from orchardcore.
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.
from orchardcore.
Of course and I did a humble PRs, so shall I make a PR or write a code snippet first
from orchardcore.
Lets take a look at a code snippet :)
from orchardcore.
Sure π
from orchardcore.
from orchardcore.
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?
from orchardcore.
Of course the configuration is very handy in almost the providers: logging, authentication .. etc. The ConsoleLogger
is good as default logging provider, also we may need sort of CompositeProvider
to log into different sources at one shoot, let me take the initiative π , I planned to do that from few weeks ago but I stuck every time on launching the url, I appreciate your effort to make the fix, it is time to move into this π
from orchardcore.
@Jetski5822 I faced some issues:
1- I got MissingMethodException
in GetRefrencingLibraries
whenever i'm trying to run unit test
2- Is there a default configuration file that we can put the logger settings
3- If I create a LoggingModule
that implement IModule
, is the DI of IServiceCollection
done out of the box, or shall I do some extra stuff
from orchardcore.
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.
public class LoggingInitiator : ILoggingInitiator {
public void Initialize(ILoggerFactory loggerFactory) {
loggerFactory.AddConsole(LogLevel.Debug);
}
}
For NLog
public class LoggingInitiator : ILoggingInitiator {
public void Initialize(ILoggerFactory loggerFactory) {
loggerFactory.AddNLog(LogLevel.Debug);
}
}
from orchardcore.
Related Issues (20)
- User Registration Validation Lists Email Missing Error Twice HOT 6
- User Registration throw exception when no email or username were provided HOT 1
- Elasticsearch index reset doesn't seems to work with "Index latest version" configuration HOT 4
- Jean-Thierry KΓ©chichian Community Award 2024 - cast your votes! HOT 1
- Use value task in INavigationProvider HOT 1
- Monthly community metrics report for 2024-08-01..2024-08-31
- How to write a elasticsearch query using query DSL to filter data according to taxonomy HOT 5
- Change the media library folders sorting logic to sort by name HOT 1
- Document `ShapeResult.Cache()` HOT 1
- ContentCulturePicker still not working with liquid templates (since v1.8.0) HOT 6
- OnDisplaying in custom ShapeTableProvider does not populate data anymore in some cases HOT 14
- Refactor Culture and supported_cultures HOT 1
- Potential perf improvements
- Prevent Displaying events from being called when a shape is cached
- Functional Tests - CMS SqlServer 2019 is failing in main HOT 1
- Blazor sample HOT 1
- OrchardCore throw a exception "ArgumentNullException: Value cannot be null. (Parameter 'source')" when it call "Orchard.ContentQueryAsync(query, queryParams)"ζΉζ³ HOT 1
- OrchardCore throwed the ArgumentException: Can not add property ArticleItemForPublic.Category.Inherited to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object HOT 5
- Docs 2.0.0 release notes HOT 2
- The role information about the user are not returned when using OpenId connect server. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orchardcore.