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

MicrosoftConsoleJsonLayout - Simulates Microsoft AddJsonConsole Formatter #555

Merged
merged 1 commit into from Nov 21, 2021

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Nov 21, 2021

Can be used like this:

<target type="file" name="logfile">
   <layout type="MicrosoftConsoleJsonLayout" includeScopes="true" />
</target>

And generates this output:

{
  "EventId": 110,
  "LogLevel": "Debug",
  "Category": "ConsoleApp.Program",
  "Message": "M1 System.Exception: Third time's the charm. System.Exception: This is the second error.",
  "State": {
    "Message": "M1 System.Exception: Third time's the charm. System.Exception: This is the second error.",
    "ex2": "System.Exception: This is the second error.",
    "ex3": "System.Exception: Third time's the charm.",
    "{OriginalFormat}": "M1 {ex3} {ex2}"
  }
}

@snakefoot snakefoot added this to the 5.0 milestone Nov 21, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #555 (8aecbdd) into master (0f63040) will decrease coverage by 1.21%.
The diff coverage is 64.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #555      +/-   ##
==========================================
- Coverage   80.63%   79.41%   -1.22%     
==========================================
  Files          17       18       +1     
  Lines        1410     1516     +106     
  Branches      230      254      +24     
==========================================
+ Hits         1137     1204      +67     
- Misses        164      187      +23     
- Partials      109      125      +16     
Impacted Files Coverage Δ
...ions.Logging/Layouts/MicrosoftConsoleJsonLayout.cs 61.95% <61.95%> (ø)
.../LayoutRenderers/MicrosoftConsoleLayoutRenderer.cs 73.01% <72.00%> (-0.46%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f63040...8aecbdd. Read the comment docs.

@snakefoot snakefoot merged commit bce11f5 into NLog:master Nov 21, 2021
@snakefoot
Copy link
Contributor Author

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

Successfully merging this pull request may close these issues.

None yet

2 participants