Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ganesh Mitra 51 posts 211 karma points
    Sep 29, 2020 @ 08:13
    Ganesh Mitra
    0

    Serilog setup for WARN and ERROR

    Hi All,

    I want to log only all WARN and ERROR (not INFO) in the log file. I read this https://our.umbraco.com/documentation/getting-started/Code/Debugging/Logging/ but not much help because of log levels only allows one of Verbose, Debug, Information, Warning, Error, Fatal.

    How can I achieve both WARN and ERROR but no INFO?

  • Kevin Jump 2348 posts 14896 karma points MVP 8x c-trib
    Sep 29, 2020 @ 08:45
    Kevin Jump
    101

    Hi,

    setting an level in the log is like setting the minimum level so it show you that level and all 'above'.

    So setting the log to Warning, will log Warning, Error and Fatal entries in the log (but not info, debug, etc)

    there is more info here : https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies