c# Best Method to create a log file

前端 未结 12 609
甜味超标
甜味超标 2020-12-28 13:37

I\'m writing a tool that\'s going to be check the health of workstations across a network, and will fix according to the issues it finds. I want to create a log file as the

12条回答
  •  萌比男神i
    2020-12-28 13:41

    Use the Nlog http://nlog-project.org/. It is free and allows to write to file, database, event log and other 20+ targets. The other logging framework is log4net - http://logging.apache.org/log4net/ (ported from java Log4j project). Its also free.

    Best practices are to use common logging - http://commons.apache.org/logging/ So you can later change NLog or log4net to other logging framework.

提交回复
热议问题