开发者

What are the benefits of using log4cxx over plain syslog()?

开发者 https://www.devze.com 2023-01-26 23:01 出处:网络
I\'ve had log4cxx recommended to me as a good way of generating log messages from C++ applications.However, plain old UNIX syslog() calls do let me output to files, or over the network, and have all t

I've had log4cxx recommended to me as a good way of generating log messages from C++ applications. However, plain old UNIX syslog() calls do let me output to files, or over the network, and have all the usual DEBUG/INFO/WARN/ERROR levels.

log4cxx is clearly more modular/customizable, but I really just want to log to a file so can't imagine needing to write any custom output functionality. I feel like I must be missing something: what does log4cxx give me over and开发者_如何学Python above using plain syslog? Performance? Robustness? Portability?


Portability.

If one day you chose to move your application to a windows environment or somewhere else that doesn't provide syslog(), you won't have to rewrite your logger.


It gives you the dubious joy of reinventing a wheel. I've seen the light, and I'm shining it. Unix works better. Syslog().

0

精彩评论

暂无评论...
验证码 换一张
取 消