Where is your code that initializes log4net? Are you initializing log4net from 
the web.config or from log4net.config?


----- Original Message ----

From: "Karnecki, David (Modis)" <[EMAIL PROTECTED]>

To: [email protected]

Sent: Monday, August 20, 2007 8:53:14 AM

Subject: log4net WILL NOT write to the log file.



     To Whom It May Concern:

  

 I have 1st insured  that the ASPNET account has write privileges on my \Log 
subdirectory before  I sent this question.

  

 The code fragment  I'm using to write with is below.  I have also tried 
example code straight  from your samples

 to no avail.   There is another app running on the same server which has no 
trouble writing to  its log file via

 log4net. I've set my  app up the same as his.

  

 Can there be any  other reason the log isn't being written?

  

 Thanks,

  

 Cordially,

 Dave  Karneck

 [EMAIL PROTECTED]

  

 
-----------------------------------------------------------------------------------------------------------------------------------------------

    log4net version :    1.2.10    Assembly type is    .dll    ASP.Net 
application    running on IIS    Desktop is WIndows    XP v5.1 SP2    debug 
file produced    is attached 
-----------------------------------------------------------------------------------------------------------------------------------------------

 CODE FRAGMENT

  
-----------------------------------------------------------------------------------------------------------------------------------------------



 Dim Log As ILog =  
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)

 Dim errMessage As String = "Task Order Types could  not be retrieved from 
table 'TASK_ORDER'."

 Dim errMsg As String = ""

  

 If IsNothing(ex.InnerException) Then

     errMsg = Log.Logger.Name.ToString() & vbCrLf & errMessage  & vbCrLf & 
ex.Message & vbCrLf &  Environment.StackTrace

 Else

    errMsg = Log.Logger.Name.ToString()  & vbCrLf & errMessage & vbCrLf & 
ex.Message & vbCrLf &  ex.InnerException.ToString

 End  If

 Log.Error(errMsg)









Reply via email to