Code Monkey home page Code Monkey logo

Comments (5)

marcinbudny avatar marcinbudny commented on July 20, 2024

Hi,
This seems reasonable. I've been thinking about changing the way getContextProperties works anyway, so that full OwinContext is passed into it, instead of request and response separately. I hope I'll have some time to look into it over the weekend.

from applicationinsights-owinextensions.

marcinbudny avatar marcinbudny commented on July 20, 2024

The work is in progress, see here. Still need to update docs and changelog though, then push to nuget.

One thing about logging the POST body: be careful. Once you read the stream, you cannot rewind it for the next middleware (like WebAPI). Recently a person told me they substitute the original stream with a MemoryStream containing copy of the data. It seemed to work, but I think it is extremely hacky. This also prevents streaming of requests.

from applicationinsights-owinextensions.

baywet avatar baywet commented on July 20, 2024

Thanks for working on that on such a short delay, and thanks for the heads up. We'll only be implementing that for the QA, front end devs are building new components and sending requests to our API that are sometimes causing issues. Logging those would help us understand what's going wrong when something goes wrong.

from applicationinsights-owinextensions.

marcinbudny avatar marcinbudny commented on July 20, 2024

The version 0.5 containing the changes is now released on nuget

from applicationinsights-owinextensions.

baywet avatar baywet commented on July 20, 2024

Thanks for the update and sorry for not answering earlier. I took some time off.
You're right: either the AI middleware executes before the WebAPI one and reading the stream messes up things, replacing it is hacky (made iisexpress crash on my dev box) or it executes after and then you basically cannot access the data.
I guess a proper way to do it would be to implement an attribute that executes before each method of the controller and serializes all parameters to the current operation.
Closing this one. Thanks for your help

from applicationinsights-owinextensions.

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.