In java world you have log4j and a a pretty decent logging framework, is there anything like that for C#/.NET?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I'd still say Log4Net is a safer options. Many other open source projects also use it, if you ever include one that does, then you've just reduced a dependency.
There's also nLog, which is rather similar, but a bit more lightweight with less configuration.
Look at TraceSources and TraceListeners. It is built into .NET and configured with the config file.
The comments here seem to agree with Developer Dude and nzpcmad, as do I. Use Bit Factory, also called The Object Guy's Logging Framework.
We've always used the MS P&P Enterprise Library Logging Application Block. It's not particulary cool or elegant, but it is pretty flexible and well designed. Main reason I think we use it is that we use a lot of the other components from the EL, and they of course all have dependencies on the logging module. More Info Here.
No doubt, try: this. Hands down, it is the best for most applications. It isn't bloatware.