Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2004, 07:22 PM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Collection as a Trace/Debug Listener?

I am a C# beginner. In VB/ASP i had developed an infrastructure that allowed recent trace/debug information to be kept in memory. It would be dumped to an error handler when exceptions were raised. Only the most recent trace entries would be retained. Is it possible to do the same with the .Net Trace class, or will i have to write my own code? From what i have read it seems that a Trace Listener can only be a stream, like writing to a disk file. This is useful, but i have other troubleshooring needs.

Thanks
 
Old June 10th, 2004, 11:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

Depending on what you need, you can create your own trace class, by inheriting from the TraceListener class. I have created my own class that will write trace entries to a database.

Brian
 
Old June 10th, 2004, 11:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

I make a slight error in my statement. I should have said you can create your own trace listener class, then add it to the trace by:

Trace.Listeners.Add(myTraceObject)

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP Listener aveekb BOOK: Professional Java Development with the Spring Framework 2 May 7th, 2008 04:03 PM
Difference between Trace.write and Debug.write surendraparashar ASP.NET 2.0 Professional 1 June 27th, 2007 02:12 AM
Webservice listener dcrooks .NET Web Services 0 February 18th, 2005 05:33 PM
using Trace Tids ASP.NET 1.0 and 1.1 Basics 0 August 15th, 2004 02:20 PM
Debug and Trace bmains ASP.NET 1.x and 2.0 Application Design 3 March 17th, 2004 09:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.