티스토리 뷰

개발/C# ASP.NET

Compare .NET Logging Frameworks

박비버 2019. 4. 30. 14:20

Top .NET 로깅 프레임웍 비교

 

log4net, NLog, Serilog

 

log4net

- 2001년에 나옴, 오래되어 많이 쓰여짐

- 오래되어서 .NET Core 에 딱 맞진 않음

log4net.config XML 작성 => 어렵다, 코드로 할 수 있는데 문서가 잘 안되어있음

- 전반적으로 문서가 잘 안되어있음

 

NLog

- 얘도 오래됨 2006년에 나옴, 최신 2017.12

- config XML 작성 필요, log4net 보다는 깔끔, 코드로 할 수 있음

log4net 보다 설정이 쉽고, 코드 기반 설정도 제공

- 뭐든 작성을 잊어버리면 어디가 문제인지 찾아주지 못함

- 로깅하다가 어플리케이션을 망가트리면 안되는데.. 로깅이 실패하면 fatal 에러가 되어버림, 로깅은 나중일이어야 함

 

Serilog

- 2013년에 나옴

- 위의 두가지와 가장 큰 차이는 얘는 어플리케이션의 out of the box에서 로깅 하도록 디자인 되어있다는 점

- 설치는 위의 두가지보단 어려움

- 모듈화 하기는 쉬움

- XML 필요없음 => 설정이 쉬움

- 다양한 destination을 제공 https://github.com/serilog/serilog/wiki/Provided-Sinks

- Retrace 제공 https://stackify.com/retrace/

 

출처 : https://stackify.com/nlog-vs-log4net-vs-serilog/

 

NLog vs log4net vs Serilog: Compare .NET Logging Frameworks

Compare three of the most popular logging frameworks in the .NET space: log4net, NLog, and Serilog. Understand each frameworks' pros and cons.

stackify.com

Serilog

Advantages

  • Structured logging and enrichment
  • Great documentation and community
  • C# based configuration

Disadvantages

  • More features to learn

log4net

Advantages

  • A lot of documentation and blog posts
  • Easy to understand when coming from logging frameworks from other languages

Disadvantages

  • No structured logging
  • Hard to configure
  • Project seems dead

 

출처 : https://blog.elmah.io/serilog-vs-log4net/

 

Serilog vs log4net - A battle between the old and the new

Serilog and log4net are popular choices when choosing a logging framework in .NET. Read this guide to learn all about each framework and what to pick.

blog.elmah.io

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함