see sharp RSS 2.0
# Friday, 13 February 2009
A trace filter is a nice thing, it can decide whether to log a message or not.

Two filters exist in the framework, and they are covered widely on MSDN.

Writing a custom filter is quite easy.
Just derive your filter class from  TraceFilter, override the one and only method ShouldTrace (which returns bool) and there you go.

Now the only thing left is to add the filter to the listener in your applications config file.

Happy Tracing...

Oh yes, here are the files:
Friday, 13 February 2009 14:35:41 (Mitteleuropäische Zeit, UTC+01:00)  #    -
Tracing | C#
Archive
<2009 February>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
Any link on this site may lead to an external website that is not under my control and that external website might show an opinion that is not mine.

© Copyright 2017
Hannes Köhler
Sign In
Statistics
Total Posts: 39
This Year: 0
This Month: 0
This Week: 0
Comments: 1
All Content © 2017, Hannes Köhler
DasBlog theme 'Business' created by Christoph De Baene (delarou)