So something like this for web apps?
Sub Application_Start(ByVal sender As
Object, ByVal e As EventArgs)
Dim file As String = ConfigurationSettings.AppSettings("log4net")log4net.Config.DOMConfigurator.Configure(New IO.FileInfo(file)) End Sub Then in your code you could do:
Private Shared log As log4net.ILog _
= log4net.LogManager.GetLogger(GetType(MyClass)) Or I
guess you can do this (Thanks Nicko)
'
Load the configuration from the 'WebApp.dll.log4net'
file
<Assembly:log4net.Config.DOMConfigurator(ConfigFileExtension:="log4net", Watch:=true)> Public Class Global
End Class
Do we
have someplace where we can write this down? Or can we add it to the 1.1 folder
I didn't even think to look in the 1.0 folder.
Dru
From: Denis, Rich [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 16, 2004 4:39 PM To: Log4NET User Subject: RE: Logging Perf Hit As for calling
Configure, I'm not sure where that goes in an ASP.Net
application. You can either call
configure manually in the app_start code or you can assign an assembly attribute
to handle the configuration call for you. For asp.net apps this seems to
works well for me. Rich
Denis From: Benjamin
Peikes [mailto:[EMAIL PROTECTED] You should make your
loggers static, one for each class. In VB that would be Shared. That way they
only get created once for each class. As for calling
Configure, I'm not sure where that goes in an ASP.Net
application. Benjamin
Peikes From: Dru
Sellers [mailto:[EMAIL PROTECTED] In my ASP.Net pages I
am doing this in about every method
Dru --- --- --- |
Title: Message
- RE: Logging Perf Hit Denis, Rich
- RE: Logging Perf Hit Dru Sellers