开发者

Logging which is the best way

开发者 https://www.devze.com 2022-12-27 18:54 出处:网络
People who talk about loggers here never talke about EventLog, I think this is good for windows system.Is it reliable, or I found it dead in some bad morning?

People who talk about loggers here never talke about EventLog, I think this is good for windows system. Is it reliable, or I found it dead in some bad morning?

EventLog let you can create a specific folder or folders for your application, I I am thinking in EventLog because both Front End and Back End and anything on the server can log into it.

So It is transparent, across applications and we can put our logging in specific folder, so I don't have to look into the zillion sys info messages.

Why not logging everything at SQLServer, I am creating E-Commerce website, if SQL server down the website will be down anyway. but I am worry about temporally connection failure, what do u think?

Why everyone like files, it can be in great 开发者_StackOverflow社区size, too big to handle, or maybe I will create another file when a file is too big, and I can create a file with a date.

Some one tried MS Enterprise library? talk to me about it.

Thanks


I think some people choose files because it is the easy option and you get the benefit of only logging the information you really want to capture. If you use the Windows event log, you are stuck trying to search through the thousands of OS events that occurred in the same minute as the log entry you are looking for.

I would suggest a logging framework that will handle your needs without weighing you down with extra junk you don't need.

I think the most commonly used logging framework for the .NET platform is log4net. But, you'll have to find the one that is best suited for your project.

Here's a related logging SO question to help you out.
https://stackoverflow.com/questions/98080/what-is-the-best-logging-solution-for-a-c-net-35-project

Personally, I can't think of a single reason in which I would primarily use the Windows OS logs for my e-commerce application.


I do use the Event log quite a bit, especially when I write Windows Services. It's very useful in locked down environments when the SysAdmins don't want you to write to the filesystem. In general I think SysAdmins quite appreciate it also since they can easily find all the important logs in one place (separated by app though as you say) without having to go looking for logfiles, but you have to be careful to not write too many entries since it can get a bit difficult to read compared with a nicely formatted text log.

I'd be reluctant to log in a database unless the logged information was used by another process (as in, I've done my work, now it's your turn to do your bit), but I'm not sure if there's any real reason to avoid that and might used be me not being used to that.

0

精彩评论

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

关注公众号