logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Goldsmith" <JGoldsm...@psmic.com>
Subject RE: Cannot switch between logging levels
Date Tue, 23 Aug 2005 02:16:37 GMT
FINALLY...I have resolved my issue.

For anyone who is interested, if you separate your log4net
configurations into its own config file (ex. log4net.config), but you
have your logger.ConnectionString set in the web.config file you can't
change the log4net logging level settings.  I attempted to follow a lot
of the good suggestions and set the adoAppender in the Application_Start
of the global.asax file, but unfortunately this did not work for me.
Now, I don't know if this is the recommended solution, nor the correct
solution, but it works and at this point that is my major concern.  If
anyone knows if there is a better way, please let me know.


Thanks for all the assistance,
 

Jason Goldsmith

-----Original Message-----
From: Jason Goldsmith [mailto:JGoldsmith@psmic.com] 
Sent: Monday, August 22, 2005 1:25 PM
To: Log4NET User
Subject: RE: Cannot switch between logging levels

Ok...I'm still having problems with switching between logging level
using the ADONetAppender.  I have implemented the Internal Debugging and
whenever I switch I receive the following message:

log4net:ERROR [ADONetAppender] Could not open database connection []
System.InvalidOperationException: The ConnectionString property has not
been initialized.
   at System.Data.SqlClient.SqlConnection.Open()
   at log4net.Appender.ADONetAppender.InitializeDatabaseConnection()
log4net: DOMConfigurator: Created Appender [AdoNetAppender]


Any Ideas?

 
Jason Goldsmith
Solution Stream
1510 N.Elms Road
Flint MI, 48532
Phone: 810.600.3913
 
-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: Wednesday, August 17, 2005 9:03 AM
To: Log4NET User
Subject: RE: Cannot switch between logging levels

>From the faq.html page:

"
Internal debugging messages are written to the console and to the
System.Diagnostics.Trace system.
"

A simple way to redirect messages sent to System.Diagnostics.Trace is
to define a trace listener in the web.config:

<system.diagnostics>
 <trace autoflush="true">
  <listeners>
   <add name="textWriterTraceListener" 
    type="System.Diagnostics.TextWriterTraceListener" 
    initializeData="C:\\inetpub\\wwwroot\\log4net.txt" />
  </listeners>
 </trace>
</system.diagnostics>

I agree that if switching log levels works correctly for one appender,
it should work for the other appenders as well.

--- Jason Goldsmith <JGoldsmith@psmic.com> wrote:

> Ok, I've attempted to enable internal debugging to no avail.  I just
> don't understand Why switching from one log level to another works
> when
> I have root as FileAppender, but doesn't work when root is set to
> ADONetAppender.  Any thoughts?  
> 
> If any of my code is necessary, please let me know.  I have, however,
> provided snippets (in my first email to the group) of my web.config,
> log4net.config, global.asax.cs, AssemblyInfo.cs.
> 
> Thanks again,
> 
>  
> Jason Goldsmith
> Solution Stream
> 1510 N.Elms Road
> Flint MI, 48532
> Phone: 810.600.3913

Mime
View raw message