473,395 Members | 1,915 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,395 software developers and data experts.

<system.diagnostics> in web.config

I have the following defined in web.config under <configuration> node:

<system.diagnostics>

<switches>

<add name="MainSwitch" value="4"/>

</switches>

<trace autoflush="true" indentsize="4">

<listeners>

<add name="myListenere" type="System.Diagnostics.TextWriterTraceListener"
initializeData="c:\myListener.log" />

</listeners>

</trace>

</system.diagnostics>

When I tried to load a page, I get a configuration exception that says there
was an exception in configuration section handler. Can some tell me what is
wrong with this configuration?

Thanks
Nov 18 '05 #1
4 15588
Wild guess, but what if you escape the \ in ="c:\myListener.log" /> by doing
=@"C:\myListener.lob"/>

"Jiho Han" <ji******@infinityinfo.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
I have the following defined in web.config under <configuration> node:

<system.diagnostics>

<switches>

<add name="MainSwitch" value="4"/>

</switches>

<trace autoflush="true" indentsize="4">

<listeners>

<add name="myListenere" type="System.Diagnostics.TextWriterTraceListener"
initializeData="c:\myListener.log" />

</listeners>

</trace>

</system.diagnostics>

When I tried to load a page, I get a configuration exception that says there was an exception in configuration section handler. Can some tell me what is wrong with this configuration?

Thanks

Nov 18 '05 #2
I'd try that but even before trying, that wouldn't be a well-formed xml,
would it?

"George Durzi" <gd****@hotmail.com> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl...
Wild guess, but what if you escape the \ in ="c:\myListener.log" /> by doing =@"C:\myListener.lob"/>

"Jiho Han" <ji******@infinityinfo.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
I have the following defined in web.config under <configuration> node:

<system.diagnostics>

<switches>

<add name="MainSwitch" value="4"/>

</switches>

<trace autoflush="true" indentsize="4">

<listeners>

<add name="myListenere" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\myListener.log" />

</listeners>

</trace>

</system.diagnostics>

When I tried to load a page, I get a configuration exception that says there
was an exception in configuration section handler. Can some tell me

what is
wrong with this configuration?

Thanks


Nov 18 '05 #3
Yeah, nevermind.. I took your Xml snippet and stuck it in my web.config file
and everything was ok.

Here's my web.config file, I just deleted everything in <appsettings> for
brevity

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>

</appSettings>
<system.web>
<compilation defaultLanguage="c#" debug="true" />
<customErrors mode="RemoteOnly" />
<authentication mode="Forms">
<forms loginUrl="login.aspx" name="adAuthCookie" timeout="240" path="/"
/>
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
<identity impersonate="true"></identity>
<trace enabled="false" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false" timeout="240" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<switches>
<add name="MainSwitch" value="4" />
</switches>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListenere"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="c:\myListener.log" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

"Jiho Han" <ji******@infinityinfo.com> wrote in message
news:u0**************@TK2MSFTNGP09.phx.gbl...
I'd try that but even before trying, that wouldn't be a well-formed xml,
would it?

"George Durzi" <gd****@hotmail.com> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl...
Wild guess, but what if you escape the \ in ="c:\myListener.log" /> by

doing
=@"C:\myListener.lob"/>

"Jiho Han" <ji******@infinityinfo.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
I have the following defined in web.config under <configuration> node:

<system.diagnostics>

<switches>

<add name="MainSwitch" value="4"/>

</switches>

<trace autoflush="true" indentsize="4">

<listeners>

<add name="myListenere" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\myListener.log" />

</listeners>

</trace>

</system.diagnostics>

When I tried to load a page, I get a configuration exception that says

there
was an exception in configuration section handler. Can some tell me

what
is
wrong with this configuration?

Thanks



Nov 18 '05 #4
I see you have asp.net tracing turned off. (<trace enabled="false">) Maybe
that's it? Hmm...
I got a lot of stuff happening in web.config. So maybe I should try it on a
default one.
Have you tried writing to trace, and did you get output in your specified
file?

BTW, I decided that I am going to use log4net for my tracing but it'd still
be useful to know whether this works or not.

Thanks for your help.
Jiho

"George Durzi" <gd****@hotmail.com> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...
Yeah, nevermind.. I took your Xml snippet and stuck it in my web.config file and everything was ok.

Here's my web.config file, I just deleted everything in <appsettings> for
brevity

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>

</appSettings>
<system.web>
<compilation defaultLanguage="c#" debug="true" />
<customErrors mode="RemoteOnly" />
<authentication mode="Forms">
<forms loginUrl="login.aspx" name="adAuthCookie" timeout="240" path="/"
/>
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
<identity impersonate="true"></identity>
<trace enabled="false" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false" timeout="240" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<system.diagnostics>
<switches>
<add name="MainSwitch" value="4" />
</switches>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListenere"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="c:\myListener.log" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

"Jiho Han" <ji******@infinityinfo.com> wrote in message
news:u0**************@TK2MSFTNGP09.phx.gbl...
I'd try that but even before trying, that wouldn't be a well-formed xml,
would it?

"George Durzi" <gd****@hotmail.com> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl...
Wild guess, but what if you escape the \ in ="c:\myListener.log" /> by

doing
=@"C:\myListener.lob"/>

"Jiho Han" <ji******@infinityinfo.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
> I have the following defined in web.config under <configuration> node: >
> <system.diagnostics>
>
> <switches>
>
> <add name="MainSwitch" value="4"/>
>
> </switches>
>
> <trace autoflush="true" indentsize="4">
>
> <listeners>
>
> <add name="myListenere"

type="System.Diagnostics.TextWriterTraceListener"
> initializeData="c:\myListener.log" />
>
> </listeners>
>
> </trace>
>
> </system.diagnostics>
>
> When I tried to load a page, I get a configuration exception that says there
> was an exception in configuration section handler. Can some tell me

what
is
> wrong with this configuration?
>
>
>
> Thanks
>
>



Nov 18 '05 #5

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

Similar topics

1
by: Tim Heuer | last post by:
Is there a way to specify proxy logon information if you use the <system.net> <proxyAddress> configuration methods for the web.config? -th
2
by: S.K. Dutta | last post by:
Hi! I am having a problem that I do not have any clue on what to do. I have tries a few obvious things... <system.diagnostics> in the main web.config file is giving configuration error on a...
0
by: I am Sam | last post by:
I don't know what is wrong with my web.config file. I can access web pages outside the "Administration" folder but when I try to access files inside that folder I get the following error: ...
3
by: MikeM | last post by:
I've been trying to locate some property or method that will allow programmatic access to the "loginUrl" attribute in the web.config file in the <system.web> -> <authentication> element when the...
3
by: Varangian | last post by:
Hello, there I have a problem with regards to System.Collections.Generic.List<T> I need to pass a class with implements an interface - TestClass : IPerson I put this class in a...
2
by: Bern McCarty | last post by:
In the old MEC++ syntax I can do this: // compile in VS 2005 shell with cl -clr:oldsyntax -LD ArrayCopyOldSyntax.cpp #using <mscorlib.dll> public __gc class CopyTest { private:...
5
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE"...
0
by: msnews.microsoft.com | last post by:
Hi, I am tring to use Trace Listener in asp.net 1.1 application as mentoned here. But i am getting the following error, Configuration Error Description: An error occurred during the processing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.