By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,016 Members | 1,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,016 IT Pros & Developers. It's quick & easy.

<system.diagnostics> in web.config

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.