Member Avatar for fatihpiristine

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

can you put some error listing up here ?

Member Avatar for fatihpiristine

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>

Member Avatar for fatihpiristine

i made it.. no problem anymore...

what was the issue? may help others if they ever get stuck with similiar problem

Member Avatar for fatihpiristine

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.

Member Avatar for fatihpiristine

Here is my solution.
requires .net 2005, .net framework 2.0 and sql server 2005

Member Avatar for fatihpiristine

new version

Member Avatar for fatihpiristine

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.