Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

EnableFormDataLogging not logging anything with WebApi #64

Closed
Dypso opened this issue Jun 4, 2019 · 2 comments
Closed

EnableFormDataLogging not logging anything with WebApi #64

Dypso opened this issue Jun 4, 2019 · 2 comments

Comments

@Dypso
Copy link

Dypso commented Jun 4, 2019

I have used this sink along with classic-webapi and use this syntax at configuration


 .EnableFormDataLogging(forms => forms
                    .AtLevel(LogEventLevel.Information)
                    .FilterKeywords(new[] { "password", "authToken" })
                )

But when I post data to my webApi I see no any information logged ... Is that even possible ? Or does it only make sense on a ASP.Net MVC project ?

@tsimbalar
Copy link
Member

FormDataLogging logs data posted through actual "Web Forms", i.e. via an actual "http form" , with application/x-www-form-urlencoded or similar.

In Web API, you typically POST contents as application/json , so you don't actually have explicit fields/values.

So to sum up : that can work only with WebForms or MVC :)

@tsimbalar
Copy link
Member

maybe related to #35 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants