473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

TextWriterTraceListener

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" />
<authorization>
<allow users="*" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="myListener.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

In code behind I try to output something like this:
System.Diagnostics.Trace.WriteLine("Tracing...");

But all the time I get an error:

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 13: <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
Line 14: </system.web>
Line 15: <system.diagnostics>
Line 16: <trace autoflush="true" indentsize="4">
Line 17: <listeners>
Source File: c:\inetpub\wwwroot\TraceListener\web.config Line: 15

Thank you for assistance.
Nov 18 '05 #1
6 2414
Sean,

See if this helps you:
http://www.vbbox.com/blog/2004/05/cu...listeners.html
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"Sean Feldman" <sh*****@eshed.co.il> wrote in message
news:35**********************************@microsof t.com...
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" />
<authorization>
<allow users="*" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="myListener.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

In code behind I try to output something like this:
System.Diagnostics.Trace.WriteLine("Tracing...");

But all the time I get an error:

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 13: <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> Line 14: </system.web>
Line 15: <system.diagnostics>
Line 16: <trace autoflush="true" indentsize="4">
Line 17: <listeners>
Source File: c:\inetpub\wwwroot\TraceListener\web.config Line: 15

Thank you for assistance.

Nov 18 '05 #2
Hi,
thatnks, but this didn't help.
I get an exception when web.config is parsed at line that contains
<system.diagnostics>
Can't figure out why. I didn't implement any custom listener, just added
TextWriterTraceListener.
Weird.

Sean.

"Klaus H. Probst" <us*******@simulplex.net> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
Sean,

See if this helps you:
http://www.vbbox.com/blog/2004/05/cu...listeners.html
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"Sean Feldman" <sh*****@eshed.co.il> wrote in message
news:35**********************************@microsof t.com...
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" />
<authorization>
<allow users="*" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="myListener.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

In code behind I try to output something like this:
System.Diagnostics.Trace.WriteLine("Tracing...");

But all the time I get an error:

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 13: <globalization requestEncoding="utf-8" responseEncoding="utf-8"

/>
Line 14: </system.web>
Line 15: <system.diagnostics>
Line 16: <trace autoflush="true" indentsize="4">
Line 17: <listeners>
Source File: c:\inetpub\wwwroot\TraceListener\web.config Line: 15

Thank you for assistance.


Nov 18 '05 #3
The concept of tracing in ASP.NET is very different from that in Windows
..NET applications. Tracing in ASP.NET outputs trace information to the
client's browser. System.Diagnostics listeners don't work in ASP.NET. (At
least this is my experience. Will be happy to hear if someone can
demonstrate opposite).

Eliyahu

"Sean Feldman" <sh*****@eshed.co.il> wrote in message
news:35**********************************@microsof t.com...
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" />
<authorization>
<allow users="*" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="myListener.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

In code behind I try to output something like this:
System.Diagnostics.Trace.WriteLine("Tracing...");

But all the time I get an error:

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 13: <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> Line 14: </system.web>
Line 15: <system.diagnostics>
Line 16: <trace autoflush="true" indentsize="4">
Line 17: <listeners>
Source File: c:\inetpub\wwwroot\TraceListener\web.config Line: 15

Thank you for assistance.

Nov 18 '05 #4
System.Diagnostics listeners work in ASP.Net.
It was demonstrated by Alik Levin (Microsoft IL) during the last conference.
Unfortunately, I can't figure out why web.config parsering fails on reading
<system.diagnostics> part...

Sean

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:Oi**************@tk2msftngp13.phx.gbl...
The concept of tracing in ASP.NET is very different from that in Windows
.NET applications. Tracing in ASP.NET outputs trace information to the
client's browser. System.Diagnostics listeners don't work in ASP.NET. (At
least this is my experience. Will be happy to hear if someone can
demonstrate opposite).

Eliyahu

"Sean Feldman" <sh*****@eshed.co.il> wrote in message
news:35**********************************@microsof t.com...
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" />
<authorization>
<allow users="*" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="myListener.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

In code behind I try to output something like this:
System.Diagnostics.Trace.WriteLine("Tracing...");

But all the time I get an error:

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 13: <globalization requestEncoding="utf-8" responseEncoding="utf-8"

/>
Line 14: </system.web>
Line 15: <system.diagnostics>
Line 16: <trace autoflush="true" indentsize="4">
Line 17: <listeners>
Source File: c:\inetpub\wwwroot\TraceListener\web.config Line: 15

Thank you for assistance.


Nov 18 '05 #5
In this section here,
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="myListener.txt" />

I thought the type attribute suppose to have the format of
type="[Class Name] , [Assembly Name]"

look in your machine.config file and you will see alot of examples of custom
section handlers

"Eliyahu Goldin" wrote:
The concept of tracing in ASP.NET is very different from that in Windows
..NET applications. Tracing in ASP.NET outputs trace information to the
client's browser. System.Diagnostics listeners don't work in ASP.NET. (At
least this is my experience. Will be happy to hear if someone can
demonstrate opposite).

Eliyahu

"Sean Feldman" <sh*****@eshed.co.il> wrote in message
news:35**********************************@microsof t.com...
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" />
<authorization>
<allow users="*" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="myListener.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

In code behind I try to output something like this:
System.Diagnostics.Trace.WriteLine("Tracing...");

But all the time I get an error:

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 13: <globalization requestEncoding="utf-8" responseEncoding="utf-8"

/>
Line 14: </system.web>
Line 15: <system.diagnostics>
Line 16: <trace autoflush="true" indentsize="4">
Line 17: <listeners>
Source File: c:\inetpub\wwwroot\TraceListener\web.config Line: 15

Thank you for assistance.


Nov 18 '05 #6
Hi,
somewhere I read that if you're using assemblies from system.dll, then you
don't have to write type="...". But still, this is not the problem.

"Tampa .NET Koder" <Ta***********@discussions.microsoft.com> wrote in
message news:A0**********************************@microsof t.com...
In this section here,
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="myListener.txt" />

I thought the type attribute suppose to have the format of
type="[Class Name] , [Assembly Name]"

look in your machine.config file and you will see alot of examples of custom section handlers

"Eliyahu Goldin" wrote:
The concept of tracing in ASP.NET is very different from that in Windows
..NET applications. Tracing in ASP.NET outputs trace information to the
client's browser. System.Diagnostics listeners don't work in ASP.NET. (At least this is my experience. Will be happy to hear if someone can
demonstrate opposite).

Eliyahu

"Sean Feldman" <sh*****@eshed.co.il> wrote in message
news:35**********************************@microsof t.com...
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" />
<authorization>
<allow users="*" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="myListener.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

In code behind I try to output something like this:
System.Diagnostics.Trace.WriteLine("Tracing...");

But all the time I get an error:

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 13: <globalization requestEncoding="utf-8"
responseEncoding="utf-8" />
Line 14: </system.web>
Line 15: <system.diagnostics>
Line 16: <trace autoflush="true" indentsize="4">
Line 17: <listeners>
Source File: c:\inetpub\wwwroot\TraceListener\web.config Line: 15

Thank you for assistance.


Nov 18 '05 #7

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

Similar topics

0
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...
0
by: Pete W | last post by:
I have a console application for which I have atttemped to use TextWriterTraceListener. The app uses System.Diagnostic I want to trace or debug to Console and also to file. code in Main()...
1
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...
1
by: Franz | last post by:
Hello NG I added a new tracelog class in a existing assebley witch is located in GAC. If I try to access a methode of this new class I'll get an errormeassage like this: Could not load type...
0
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." ...
12
by: Martyn Fewtrell | last post by:
Hi there I'm trying to find the correct way to write exceptions to the Application log using Vb.Net. I've done a fair bit of Googleing and although this gets plenty of mentions and that this...
0
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...
0
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.