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

Added ApplicationInsightsPropertyFormatter for flattening complex properties #14

Merged
merged 1 commit into from Jun 15, 2016

Conversation

Projects
None yet
2 participants
@olegKoshmeliuk
Copy link
Contributor

olegKoshmeliuk commented Jun 15, 2016

Implemented new behavior for AI custom properties for better integration with Analytics queries
Fix for #13

Example:

logger.Information("Got request:{@string} and {@dto} ", "[\"string\"]",
                new
                {
                    number = 1,
                    list = new object[] {1, "test"},
                    inner = new {a = "a", b = "b"},
                });
//Will produce 

Old behavior:

{
  "LogLevel": "Information",
  "RenderedMessage": "Got request:\"[\\\"string\\\"]\" and { number: 1, list: [1, \"test\"], inner: { a: \"a\", b: \"b\" } }",
  "string": "\"[\\\"string\\\"]\"",
  "dto": "{ number: 1, list: [1, \"test\"], inner: { a: \"a\", b: \"b\" } }"
}

New behavior:

{
  "LogLevel": "Information",
  "MessageTemplate": "Got request:{@string} and {@dto}",
  "RenderedMessage": "Got request:\"[\\\"string\\\"]\" and { number: 1, list: [1, \"test\"], inner: { a: \"a\", b: \"b\" } }",
  "string": "[\"string\"]",
  "dto.number": "1",
  "dto.list.0": "1",
  "dto.list.1": "test",
  "dto.list.Count": "2",
  "dto.inner.a": "a",
  "dto.inner.b": "b"
}

@jbattermann jbattermann merged commit 2030bcc into serilog:master Jun 15, 2016

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@jbattermann

This comment has been minimized.

Copy link
Contributor

jbattermann commented Jun 15, 2016

LGTM 👍 Thanks a lot @olegKoshmeliuk !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment