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

Is serilog file format supported? #353

Open
raelb opened this issue Jul 4, 2022 · 4 comments
Open

Is serilog file format supported? #353

raelb opened this issue Jul 4, 2022 · 4 comments
Labels

Comments

@raelb
Copy link

raelb commented Jul 4, 2022

Hello,

Is serilog file format supported in the latest release version (0.9.6.2)? By default, it seems not:

image

Please tell me what steps are required to enable serilog support.
Thanks

@jrod567
Copy link

jrod567 commented Aug 15, 2022

Same issues here. Serilog shows under the Custom log formats area so it was supported at some point. I've tried using the custom formats, but no luck either.

@Kittyfisto
Copy link
Owner

@raelb, @jrod567 Sorry for the late reply, I've been on an extended hiatus as far as my development projects were concerned.

The latest Tailviewer version (which is not yet released, but good enough to be used - I use it in my daily business) is capable of parsing serilog files, given that one configures the precise format string with tailviewer first:

  1. Download and install the latest Tailviewer version: https://ci.appveyor.com/project/Kittyfisto/sharptail/build/artifacts
  2. Start Tailviewer, click File and then Settings
  3. Click the "Plus" Icon next to Serilog in the list of custom file formats (yes, the UI is horrible)
  4. Enter {Timestamp:yyyy-MM-dd HH:mm:ss.fff K} [{Level:u3}] {Message} in the right-most input field:
    image
  5. Restart Tailviewer

Given that the formatting string is correct, you should see that Tailviewer has detected the log levels correctly and colorized the log entries accordingly:

image

The format string should be the same one that you use to configure serilog (See https://github.com/serilog/serilog/wiki/Formatting-Output), but if you find discrepancies, please let me know - you'll be the first ones to try this out besides myself. Plus the UI is really unhelpful and doesn't provide any useful feedback when inputing these format strings.

@jrod567
Copy link

jrod567 commented Sep 9, 2022

Kittyfisto - Thanks so much for the response - this is working great for me now!
I ended up using the following Serilog format: {Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] {Message}

@pikoslav
Copy link

What about full message template, f.e.:
[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] {Message:lj} {Properties} {NewLine}{Exception}

(from the same Wiki above)?

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

No branches or pull requests

4 participants