Comments (5)
Created a PR: #8
from autofac-serilog-integration.
Thank you for the PR! Not a scenario I'd given any thought to.
I'm a bit rusty on how the MEF integration works - would you be able to give a code sample showing how the updated API is used?
Regards,
Nick
from autofac-serilog-integration.
Using the updated api, I can register the logger like so:
builder.RegisterLogger(configureRegistration: x => x.Export());
That way, the logger is being declared as an export and I can inject it into a resolved MEF component using Autofac.
However I think it would be good idea to have this API generally, because if I'm going to register a component within my IoC, I want at least to be able to define how the component is being registered. Maybe I need a special lifetime? Maybe I want to provide additional metadata?
from autofac-serilog-integration.
Thanks for the follow-up! Makes sense.
It's a nice tidy PR, but given how small this project is I think it might be better in this case to grab the code and modify it in your own project. I'd like to keep the API of this one trivially simple, and I'm not sure exposing some of the implementation (i.e. generic arguments on IRegistrationBuilder<,,>
will hold up over time. Would this work for you?
from autofac-serilog-integration.
Yup, works for me. I cannot say anything about the consequences of exposing the generic IRegistrationBuilder<,,>
, so this is probably for the best.
Thank you for your time. :)
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
- 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.