Comments (4)
I think this still happens if you use RegisterLogger(builder, logger, dispose: true)
. I think that the issue is that LoggerProvider
is registered per-dependency instead of singleton:
builder.Register(c =>
{
LoggerProvider provider = new LoggerProvider(_logger);
return provider;
})
.AsSelf()
.AutoActivate()
.OnRelease(c => c.Release());
from autofac-serilog-integration.
Thanks @srogovtsev - I think you're right 👍
from autofac-serilog-integration.
I think I can take this, but there's one thing I'd like to understand: is there any reason you don't want LoggerProvider
to be single-instance?
(actually, this mirrors the Microsoft.Extensions.Logging integration, where it is single-instance)
from autofac-serilog-integration.
I think single-instance would be correct, here (though it's been a while since I've worked in this codebase...). Thanks for the offer of help! 👍
from autofac-serilog-integration.
Related Issues (20)
- any plan to get this one supported .net core? HOT 2
- New version of package with serilog 2.x dependency HOT 1
- Reference for breaking changes between 1.x and 2.x? HOT 2
- Customization of the ILogger dependency configuration HOT 5
- ILogger for Controller is not correctly resolved HOT 3
- Method not found ModuleRegistration failed HOT 1
- SourceContext not being injected into BackgroundService (net core 3.1 app autofac5) HOT 1
- Performance overhead for components not consuming ILogger HOT 2
- Autofac 6 migration HOT 1
- Unable to install the package in project framework targeted 4.0 HOT 1
- System.MissingMethodException: Method not found: 'Void Autofac.Core.IComponentRegistration.add_Preparing HOT 2
- Not working with Autofac 6.X.X HOT 1
- MissingMethodException in AutofacSerilogIntegration.ContextualLoggingModule.AttachToComponentRegistration HOT 2
- Injection doesn't work for `AutofacChildLifetimeScopeConfigurationAdapter`
- AutofacSerilogIntegration.dll has the wrong file version HOT 1
- Using ILogger from 'Microsoft.Extensions.Logging.Abstractions' HOT 2
- Support AutoFac 9, Serilog 3, .NET 4.8.1 HOT 1
- Doesn't add SourceContext in ASP.Net 5 controllers with ILogger injected HOT 7
- Custom ILogger registration? HOT 5
- ContextualLoggingModule gets registered twice when using Autofac's assembly scanning 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 autofac-serilog-integration.