hello guys...

long time not to involve to c#/asp.net so i dont remember so many things.

i have problems to adapt log4net to my website to log all the activities.. i checked and tried out so many things but nothing works. i have sample web application from its producer but it doesnot work too(written in vs2003, after converting vs2005 gives messages like object not found etc. etc.

does anyone have ideas about that?

thanx in advance,

Miller

fatihpiristine
Deleted Member

the problem is i got this

Line 7:
Line 8:
Line 9: <log4net debug="false">
Line 10: <appender name="LogFileAppender" type="log4net.Appender.FileAppender" >
Line 11: <file value="webapp-log.txt" />


the code on those lines:


<log4net debug="false">
<appender name="LogFileAppender" type="log4net.Appender.FileAppender" >
<file value="webapp-log.txt" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
</layout>
</appender>
<appender name="HttpTraceAppender" type="log4net.Appender.AspNetTraceAppender" >
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
</layout>
</appender>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="log-data\rolling-log.txt" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="5MB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="LogFileAppender" />
<appender-ref ref="HttpTraceAppender" />
<!-- <appender-ref ref="RollingLogFileAppender" /> -->
</root>
</log4net>

i made it.. no problem anymore...

if u r familiar with .net, u know the common conversion issues from 2003 to 2005 or 2008. i ll post it here soon... which work with simple log file and sqlserver.

This is the output :) works as one class file, but a bit slow on database logging.
2008-01-17 17:32:51 INFO MSDOM\809133 ActivityLogs._Default ActivityLogs._Default.mAdd_Click(C:\Users\809133.MSDOM\Documents\Visual Studio 2005\Projects\ActivityLogs\ActivityLogs\Default.aspx.cs:27) Did Something
2008-01-17 17:34:04 INFO MSDOM\809133 ActivityLogs._Default ActivityLogs._Default.mAdd_Click(C:\Users\809133.MSDOM\Documents\Visual Studio 2005\Projects\ActivityLogs\ActivityLogs\Default.aspx.cs:27) Did Something

This question has already been answered. Start a new discussion instead.