GithubHelp home page GithubHelp logo

Comments (7)

FantasticFiasco avatar FantasticFiasco commented on June 3, 2024

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.

justSteve avatar justSteve commented on June 3, 2024

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.

FantasticFiasco avatar FantasticFiasco commented on June 3, 2024

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.

justSteve avatar justSteve commented on June 3, 2024

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.

FantasticFiasco avatar FantasticFiasco commented on June 3, 2024

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.

justSteve avatar justSteve commented on June 3, 2024

from serilog-sinks-http.

FantasticFiasco avatar FantasticFiasco commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.