DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   log4net issues (http://www.daniweb.com/forums/thread104829.html)

fatihpiristine Jan 15th, 2008 10:13 am
log4net issues
 
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

Fungus1487 Jan 15th, 2008 10:26 am
Re: log4net issues
 
can you put some error listing up here ?

fatihpiristine Jan 16th, 2008 5:14 am
Re: log4net issues
 
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>

fatihpiristine Jan 16th, 2008 12:22 pm
Re: log4net issues
 
i made it.. no problem anymore...

Fungus1487 Jan 17th, 2008 4:28 am
Re: log4net issues
 
what was the issue? may help others if they ever get stuck with similiar problem

fatihpiristine Jan 17th, 2008 5:53 am
Re: log4net issues
 
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.

fatihpiristine Jan 17th, 2008 7:21 am
Re: log4net issues
 
1 Attachment(s)
Here is my solution.
requires .net 2005, .net framework 2.0 and sql server 2005

fatihpiristine Jan 17th, 2008 11:30 am
Re: log4net issues
 
1 Attachment(s)
new version

fatihpiristine Jan 17th, 2008 11:50 am
Re: log4net issues
 
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


All times are GMT -4. The time now is 9:47 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC