473,770 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with TextwriterTrace Listener

WT
Hello,

My code is using a class inherited from TextWriterTrace Lister, creating a
new object on Application_Sta rt and inserting it in the listeners
collection.
This has run for years,but on a new 2003 server with all last fixes, I am
unable to get a trace, it seems that our code is not called, no trace file
is writen on disk.
trying a remote debug with vs2005, we step in Application_Sta rt after
changing web.config, and then it start tracing. But unfortunately, we were
unable to do this twice, changing web.config doesn't trigger
Application_Sta rt anymore.
What could be the reason ?

Thanks for help
CS
Aug 9 '07 #1
1 2475
Hello CS,

From your description, you're programmaticall y register a custom
TraceWriter(der ived from TextTraceWriter ) in ASP.NET application in
Applicaiton_Sta rt event, however, after deploy on a new windows 2003 server
box, you found that custom trace writer not work, correct?

I've also performed some tests on my side, I've tested create and
registering a custom TextTraceWRiter in applicaiton_sta rt event and deploy
the application on both XP and 2003 server boxes, both of them work.
Therefore, I think this approach itself should be supported and reasonable.
My code in Application_Sta rt(global.asax) is also very straightforward :

void Application_Sta rt(object sender, EventArgs e)
{
ClassLibrary1.C ustomTextTraceW riter cttrace = new
ClassLibrary1.C ustomTextTraceW riter(@"E:\temp \log_temp\dynam ic_trace_log.tx t
");
cttrace.Name = "dynamic_trace_ writer";
System.Diagnost ics.Trace.Liste ners.Add(cttrac e);
}

For the problem you met, I think it is likely due to something incorrectly
with the server environment. To first isolate the problem symptom, I would
suggest you perform the following tests:

** Since ASP.NET 2.0 web site support precompiled and non-precompiled
deployment model. You can try both approaches to deploy your web
application on that server to see whether it works

** You can create a new ASP.NET 2.0 web application which mainly contains
the trace writer registering and using code to see whether it also suffer
the problem on that server.
for checking the regisered trace listeners, currently I simply loop through
and printout all the registered listeners in a page's code. e.g.

========

protected void Button1_Click(o bject sender, EventArgs e)
{
foreach (TraceListener listener in
System.Diagnost ics.Trace.Liste ners)
{
Response.Write( "<br/>" + listener.Name + ": " +
listener.GetTyp e());
}
}
===========

You can also put such a simple page to verify the trace listner collection
of the running application.

If you have any other finding or anything I've missed, please feel free to
post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3854
by: Ant Corrie | last post by:
I am at a loss as to why this is not working. I am trying to setup a TextWriterTraceListener in my application config file and then execute the app from the network. I get a security exception (listed below) even though I have StrongNamed my application and used the .NET Configuration Tool to create a Code Access Group in the Machine Policy that gives FullTrust to assemblies with the StrongName that I created. If you uncomment the code...
1
6030
by: Didier Bolf | last post by:
hello I'd like to add a listener in the app.config of my application, something like <add name="myListener" type="System.Diagnostics.TextWriterTraceListener"/> I can use initializeData="mylog.txt" to trace in a file but I 'd like to trace in the console but I can't find how to do ... I can't see any samples of that in msdn or elsewhere thanks for your help didier
6
2454
by: Sean Feldman | last post by:
Hello, I'm trying to insert TextWriterTraceListener to web.config file, but it fails all the time. This is my web.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation defaultLanguage="c#" debug="true" /> <customErrors mode="RemoteOnly" /> <authentication mode="Windows" />
0
1306
by: julien | last post by:
Hi, I have the following listeners in the web.config: <add name="FileTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="D:\CapriMon\CapriMon.log"/> <add name="EventLogTraceListener" type="System.Diagnostics.EventLogTraceListener" initializeData="CapriMon"/> In my codebehind, I use Trace.WriteLine(...) whenever I want to log
2
3753
by: Chucker | last post by:
Hi Community, I think I can store Binary Data in SQL Server but when I try to retrieve it, I always only get one byte. I think I stored my Binary Data in SQL Server in a Colum of Type Image. At least when I execute the following code, I get some significant network traffic. When I check the database with query analyzer, I see 4 Hex Chars in the image colum. Like 0xe0 etc.
0
1085
by: raju | last post by:
If add the following section to web.config for my ASP.NET, it fails to add listeners at startup and raises exception: "Parser Error Message: Exception in configuration section handler." <system.diagnostics> <trace autoflush="true" indentsize="0"> <listeners> <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="myTrace.txt"/>
7
1905
by: =?Utf-8?B?VGhlIE1hbiBGcm9tIFNRTA==?= | last post by:
I'm having the darndest problem and I can't seem to recreate it anywhere, and I'm looking for someone with a little insight. I've created a custom EmailTraceListener which implements the TraceListener abstract class. The EmailTraceListener stores all of the messages in a StringBuilder internally and then writes the StringBuilder.ToString() to an email as a text message. Here's the problem I'm encountering. I load up several...
0
1320
by: Erik Cruz | last post by:
Hi. I am trying to execute the steps of the walkthrough "Integrating ASP.NET Tracing with System.Diagnostics Tracing". But when I change my Web.config to use the listeners, I receive errors for the element TextWriterTraceListener: <system.diagnostics> <trace autoflush="true"> <listeners> <add name="WebPageTraceListener" type="System.Web.WebPageTraceListener,
0
277
by: WT | last post by:
Hello, Using a custom tracelistener inherited from TextWriterTraceListener, I have problems on a server. No trace file is created and no trace are written. I try our normal program based approch to add our listener to listeners collection then the declarative way in web config unsucessfully. We create the listener in the App_Start HTTP handler and add it there in the collection. How to check that our listener is added to listener...
2
2664
by: | last post by:
I set up a TextWriterTraceListener in the App.config file. I'd like to be able to tell, programmatically, which file it's using. However, I don't seem to be able to get at the initializeData attribute. The Attribute collection attached to the TextWriterTraceListener is empty. Any ideas as to how I might get at this file name without having to parse App.config?
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.