My application uses the trace object to log the information, the information is captured in a file with TextWriterTraceListener and it Works perfectly, however, I would like to add another tracelistister who will record information for a web service. In other words, I need a HTTTPLSTener besides, I need intelligent , I do not want to see an HTTP request for every log entry
How do you prepare such a thing will do? I know that I have to be the successor of Tracey Elliser (the documentation is something hidden ...) but does anyone have an idea if any HTTTCLSTER already exists ? I do not want to change the wheel again ...
Thank you!
Due to your requirements regarding variable logging, do not issue a request for each entry, you are certain You will need to create your own listener.
Get a copy of MSDN document on Trace Allison ()
"To implement custom listeners for debug and trace classes, at least, you write and WriteLine In addition, you can implement failing, closing and flush methods. "
I start with:
- Trace Get from Listener.
- Apply / write line methods
- Write your logic to the Web service. If you use base class implementation, WriteLine simply connects to a line terminator.
- Override the failed / off / flush required for your application.
Those 5 ways you need all the access to implement your listener.
Comments
Post a Comment