You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "Karnecki, David (Modis)" <ka...@ne.bah.com> on 2007/08/20 14:53:14 UTC

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
dck@dasu-ent.com
 
------------------------------------------------------------------------
-----------------------------------------------------------------------

*	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().Dec
laringType)
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)