locked
Easy Log library for web api and console app (c#) RRS feed

  • Question

  • User1518652412 posted

    I understand Enterprise Logging is difficult to configure for web api.

    What is the easy to use, install and configure Log libary for web api and console app?

    I just would like to write log to log file and use the log file for debugging purposes.

    Thanks.

    Friday, February 24, 2017 4:57 AM

All replies

  • User765422875 posted

    I think log4net or NLog are solid options.

    https://github.com/NLog/NLog

    https://logging.apache.org/log4net/

    Friday, February 24, 2017 10:20 PM
  • User-2057865890 posted

    Hi Pty1196account,

    A collection of .NET logging libraries

    https://github.com/quozd/awesome-dotnet#logging

    Best Regards,

    Chris

    Wednesday, March 1, 2017 12:28 AM
  • User842257015 posted

    Hi,

    I would suggest Serilog, Elmah. 

    If you want to trace unhandled exception, go with Elmah,  minimum configuration enough to setup.

    For tracing/debugging better to use Serilog, it supports different data storage( Flat file, Console, SQL server, cloud)

    Log Event Levels

    Event

    Level

    Description

    Verbose

    0

    Tracing information and debugging.

    Debug

    1

    Internal control flow and diagnostic

    Information

    2

    Relevance to outside observers

    Warning

    3

    Indicators of possible issues or service

    Error

    4

    Indicating a failure within app or system

    Fatal

    5

    Critical error causing complete failure of the app

    https://serilog.net/

    https://elmah.github.io/

    Thanks,

    Wednesday, March 1, 2017 3:37 AM