Comments (4)
It is a factory so it is supposed to only create the instance once per type/category creation if I remember correctly. Creating the logger is expensive and isn't supposed to be recreated with each and every call.
from rocklib.logging.
That's all fine and good, but that call doesn't check that the instance has been disposed of if/when someone does use DI as something other than Singleton.
Alternatively, the decision to use scoped over a singleton or visa-versa should be left up to the developer (recommended usage can be placed in the documentation explaining why it may be a bad idea to not use a singleton, as it stands, there is no explanation that a new version of the logging class will be created when an existing version is disposed of)
from rocklib.logging.
Indeed it does not dispose of the logger instances in 1.x. We've addressed the issue in the 2.0 version, which has pre-releases published to nuget right now (we anticipate publishing the release version next week). Instead of LoggerFactory.GetInstance
, version 2.0 has two methods: LoggerFactory.Create
and LoggerFactory.GetCached
. This is exactly your suggestion. 😄
from rocklib.logging.
that it is, thanks for the update!
from rocklib.logging.
Related Issues (10)
- Rock.Framework.Logging HOT 4
- Add retry logic to `HttpEndpointLogProvider.WriteAsync` to avoid async exceptions
- Finish 2.x Documentation - Review Documentation
- Finish 2.x Documentation - Expand documenation
- Finish 2.x Documentation - Change format of documentation
- Finish 2.x Documentation - Add missing documentation
- NET6.0 HOT 1
- Include ThreadID in the extended properties of a LogEntry by default
- LoggerLookupRegistration fails if you have multiple instances of ILogger registered HOT 4
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 rocklib.logging.