Comments (1)
Your logger provider can implement ISupportExternalScope
which you need to then implement SetScopeProvider
in the provider.
And you can either make your own ScopeProvider then or extend Microsofts one to do what you want by newing up LoggerExternalScopeProvider
in the LoggerExternalScopeProvider
Yea its a bit gobbly gook but its actually separated out really nicely.. just not documented anywhere. We spent quite some time working this out by looking at the source code in MS.
So any way there are a few things you can do now really.. In the implementation of Log in your Logger you can access more information in the ScopeProvider. For example we loop the scope to avoid wrapping BeginScope in usings.. We just use it as tracking steps so we loop over the scopes and dump them into our logs.
We also created like our own IFormatScopes interface which we can add on our objects and when we loop the scopes we do some type checking in a switch, if we have this interface then we call the GetScopes method on it and its in the format that we want. You could also have that implement the actual log data if you wanted.
From here its all really in your control.. Just make sure its really fast to work with these scopes .. if you find your self needing to use async.. well thats wrong you cant do that.. These need to be rapid because in production you WILL have this hitting thousands of times a second if not more.
from stackify-api-dotnet.
Related Issues (20)
- Cache reflection lookup for TransactionID in Net Core logs
- Web Monitors
- CoreLogger should add template parameters as searchable metadata
- PII Leak concern - GDPR HOT 5
- NLog target does not capture Properties HOT 3
- Question: use NLog or log4net? HOT 1
- Wrong server name on .net core HOT 2
- ASP.NET Core 2 support - ILoggingBuilder extension HOT 1
- StackifyLib.Config.LoadSettings overrides any explicit ApiKey, AppName, or Environment set programmatically
- App crash with ASP.NET Core HOT 1
- Make ProfileTracer support non-wrapped calls for Azure WebJobs HOT 3
- Why didn't you separate the packages? HOT 1
- Need support of MappedDiagnosticsLogicalContext instead of CallContext HOT 1
- RequestTracerMiddleware Sending 200 response when Exception thrown HOT 8
- Configuring proxy with .NetCore2.1 HOT 3
- Upgrading from 2.1.0 breaks aspnet_merge HOT 3
- Synchronous Task.WaitAll() in LoqQueue causes async/await performance problems in .NET Core
- What does #errorgoverned do? HOT 3
- LogicalThreadContext items not showing up in json contextObject for aspnet core apps HOT 9
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 stackify-api-dotnet.