如何使用asp.net或azure写入本地文件夹? [英] How to write log in local folder using asp.net or azure?

查看:53
本文介绍了如何使用asp.net或azure写入本地文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将日志存储在本地存储中。



我尝试过:



如何使用Asp.Net或Azure写入本地文件夹?

I want to store logs in local storage .

What I have tried:

How to Write Log in local Folder using Asp.Net or Azure?

推荐答案

有很多方法可以在asp.net中编写日志

- 在global.asax中使用Application_Error事件(这里需要在项目中创建Logs_App和logs_Error文件夹,它每小时创建一个日志文件,一个用于活动,一个用于错误。检查< a href =http://www.codeproject.com/Articles/429167/Activity-Logging-and-Error-Logging-in-ASP-NET>这个 [ ^ ]

- 使用事件日志,(使用EventLog类,您可以编写登录系统事件日志,请参阅这个 [ ^ ])

- 使用纯文本文件

- 使用数据库
There are many ways to write a log in asp.net
- using Application_Error event in global.asax (Here you need to create the Logs_App and logs_Error folders in your project, It creates one log file on an hourly basis, one for Activities and one for Errors. check this[^]
- using Event Log, (use EventLog class and you can write log in system event log see this[^])
- Using a plain text file
- Using database


这篇关于如何使用asp.net或azure写入本地文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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