Comments (7)
The sink supports custom implementations of a HTTP client, which means that you should be able to set your headers as you please. The payload format is also fully configurable, which means whatever format LA expects, you should be able to provide with some configuration.
from serilog-sinks-http.
Thanks for the quick reply - makes sense. So the HTTP client would be constructed during the page's lifetime as opposed to being placed in the config.
from serilog-sinks-http.
Can you elaborate on what you mean by page? I most situations the logs are sent from the backend, but you seem to indicate that the logs will be sent from the frontend?
from serilog-sinks-http.
Sorry for the confusion - a poor choice of words. I've been focused on an MVC app and spend most of my time logging within methods that produce 'pages'.
from serilog-sinks-http.
Ok, it seems like server generated HTML seems to get some traction again, always nice to see!
Regardless of whether the HTML is generated on the server or the app is a SPA, I would advice to setup the logging once when the web server is started. Nicholas Blumhardt, the author of Serilog, has written an article describing how one would setup logging in .NET Core. Configuring Serilog.Sinks.Http should be done here, thus your custom implementation of a HTTP client should be defined here as well, and the lifetime of that HTTP client would match the lifetime of the web server, not the lifetime of the page rendering.
Does this answer your question?
from serilog-sinks-http.
from serilog-sinks-http.
Nice, thanks! I will definitely read that one.
Hope your endeavour with Serilog turn out to be successful. If you are having any issues with this sink, please get in touch with me and we'll try to work it out.
Have a nice weekend!
from serilog-sinks-http.
Related Issues (20)
- Change non-durable sink to require an explicit queue limit, or null for no limit HOT 2
- DurableHttpSink sometimes split log event and sometime merge other log event in-between HOT 9
- License years in Directory.Build.props is not updated
- Remove support for .NET 4.5 HOT 1
- custom http client version 8.0 HOT 3
- configure via appsettings: logEventsInBatchLimit failing HOT 4
- Bookmark file is being used by another process HOT 27
- Test
- UnauthorizedAccessException D:\Windows\system32\Buffer.bookmark on Azure App Service (IIS) HOT 3
- Escape characters inside my Post Body HOT 3
- Add ability to select the extension of log files on durability HOT 7
- Add SSL Support HOT 3
- Bufferfile is not processed after deployment. HOT 5
- Ingest fetch call from blazor does not pass CORS check HOT 13
- Allow Option For Archiving Rolled Buffer Files HOT 2
- Log level switch
- Add new parameter to limit size of the internal queue by log events count HOT 4
- After NET 8 upgrade - FileNotFoundException (Serilog.Sinks.PeriodicBatching) HOT 4
- Configuring Logstash Similar to Elasticsearch Sink's Index Format Property HOT 4
- No properties from Enricher on update from 7.2.0 to 8.0.0 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 serilog-sinks-http.