I want to implement logging with EntLib Logging and hook up two TraceListeners for category "Debugging". One will write those messages to file and other will output them to system trace output the same way Debug.Write does (so that I could monitor them with Sysinternals DbgView), but I can't find how to setup this second listener with formatter that I need. All I really need is just message but it outputs whole bunch of stuff, like EventId, Priority etc. How do I cut all this stuff out?
相关问题
- I want to trace logs using a Macro multi parameter
- Error message 'No handlers could be found for
- convert logback.xml to log4j.properties
- Django management command doesn't show logging
- apache modules ap_log_perror is at a different lev
相关文章
- how do I log requests and responses for debugging
- Android Studio doesn't display logs by package
- Stacktrace does not print in Glassfish 4.1 Cluster
- Out of curiosity — why don't logging APIs impl
- Laravel log file based on date
- Java -How to get logger to work in shutdown hook?
- Codeigniter not logging
- Is there any way to remove the information line fr
In the EntLib configuration for your app you specify which Formatter you wish to use. The default formatter includes all this information. To remove the information you are not interested either remove them from the TextFormatter you are currently using or create a new text formatter containing the fields you want and change "Debugging" to use your new formatter.
I found a nice walkthrough on MSDN: Creating a Custom Trace Listener
It does exactly what I need. Here is a full code I ended up with:
Configuration file:
And the usage goes like this:
Both end up in debug output easily traceable by DbgView.