Log4xxx确实是一个能够跨语言跨平台的Solution,不过确实存在几个问题:

  • 过于繁琐的配置,每次项目需要copy-paste,而且哪里记得那么多logger和参数
  • 如果采用txt,当日志很多的时候,虽然可以配合工具进行分析,不过还是略显简单和粗糙

如果在Windows平台下,个人觉得还是借助Windows提供的日志机制更为经济。
关于EventLog的文章直接在google就O了,不过这里需要提几个点:
1. 删除自定义日志,貌似没有GUI,需要注册表删除,然后删除evtx文件。
eventlog的相关信息基本都在下面能找到,包括log-source的绑定关系
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog
2. 一旦source进行绑定后,如果需要修改这个source-log的关系,则需要手动在log节点下删除source项。然后重新CreateEventSource。发现通过代码DeleteEventSource无效。
http://www.eggheadcafe.com/community/aspnet/2/10022041/writing-to-custom-event-log.aspx

Once you create an event source, you cannot reuse that event source name. The framework searches through all of the event sources on the machine, and if it finds one that matches the name, it uses it. To make the code work properly, you need to create a new event source.

其实操作注册表就好了,注册表其实就是Windows的根据地,不要客气,兄弟们,上。
项目中封装了一个Logger,供大家参考,;等项目结束后,想写一下Log的实践,其实还是很有讲究的。