Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example to demonstrate registration of the EcsTextFormatter within an AspnetCore application. #63

Merged
merged 6 commits into from
Mar 16, 2020

Conversation

codebrain
Copy link
Contributor

Fixes #62

  • Also ensures any access to the resolved HttpContext are null-checked before access
  • Also enhances parsing of the UserAgent using a static property, provided by including code from https://github.com/ua-parser/uap-csharp (Apache 2.0)

… AspnetCore application.

Fixes #62

- Also ensures ay access to the resolved HttpContext are null-checked before access
- Also enhances parsing of the UserAgent using a static property, provided by including code from https://github.com/ua-parser/uap-csharp (Apache 2.0)
Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a couple of comments

Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@olavaukan
Copy link

Brilliant! This does the trick nicely. Can confirm that this solves #62 for me when running locally.

For some reason I didn't know you could get services from ctx.Configuration this way, so that was very useful. Totally agree that an Examples project is super useful here!

I have a suggestion for the Elastic.CommonSchema.Client.Ip field to be changed to string[] and then the value be split so we have separate IPv4 and IPv6 values, but I'll submit a separate feature request for that.

@codebrain codebrain merged commit 5c91591 into master Mar 16, 2020
@codebrain codebrain deleted the serilog-registration branch March 16, 2020 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request v1.4.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] MapHttpAdapter is always null so no data from HttpContext is logged
3 participants