如何为Windows应用程序生成日志文件 [英] How to generate a logfile for windows application

查看:80
本文介绍了如何为Windows应用程序生成日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我开发了一个Windows应用程序,其中我确实有一些功能,如查找/替换,合并列,拆分列和所有。

现在我想为这个Windows应用程序生成一个日志文件。任何人都可以帮我编写为我的Windows应用程序生成LOG文件的程序吗?



我尝试过:



我是这项任务的新手,因为我不知道在哪里以及如何开始这项工作,所以我没有做大事。

解决方案

请查看 Apache log4net [ ^ ]:



引用:

Apache log4net库是一个帮助程序员将日志语句输出到各种输出目标的工具。 log4net是Microsoft®.NET运行时的优秀Apache log4j™框架的一个端口。我们在框架中保留了与原始log4j类似的框架,同时利用了.NET运行时中的新功能。



功能



支持多个框架

输出到多个日志记录目标

分层日志记录架构

XML配置

动态配置

记录上下文

经过验证的架构

模块化和可扩展的设计

高性能和灵活性




只需使用类似c#的内容询问您选择的搜索机器logfile。



CP的一些结果:

非常简单的日志编写器 [ ^ ]

简单日志 [ ^ ]

简单错误记录Util类 [ ^ ]


Hi,

I have developed a windows application where i do have some functionalities in it like Find/Replace, Merge the columns, Split the columns and all.
Now i want to generate a logfile for this windows application. Can anyone help me to programme generating the LOG file for my windows application?

What I have tried:

I'm new to this task and i didn't give a big to do as i'm unaware where and how to start this.

解决方案

Please take a look at Apache log4net[^]:

Quote:

The Apache log4net library is a tool to help the programmer output log statements to a variety of output targets. log4net is a port of the excellent Apache log4j™ framework to the Microsoft® .NET runtime. We have kept the framework similar in spirit to the original log4j while taking advantage of new features in the .NET runtime.

Features

Support for multiple frameworks
Output to multiple logging targets
Hierarchical logging architecture
XML Configuration
Dynamic Configuration
Logging Context
Proven architecture
Modular and extensible design
High performance with flexibility


Just ask the search machine of your choice using something like "c# logfile".

Some results from CP:
Really Simple Log Writer[^]
Simple Log[^]
Simple Error Logging Util Class[^]


这篇关于如何为Windows应用程序生成日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆