Above section defines the configuration parameters to be used for logging.

RollingLogFileAppender describes the appender to be used for logging. This means that the log should be written in a file, which will rollover when full. There are several other appender available and more than one appender can be attached to a logger.

The layout is responsible for formatting the logging request, whereas an appender takes care of sending the formatted output to its destination. Layout used above would format the output as below:

2006-07-14 20:26:04,033 [1736] ERROR Utility [PayStub] - Could not find a part of the path
"c:\inetpub\wwwroot\TestProj\Template\PayStub.xml"

Step 4: If you want log4net to add its own diagnostics messages then add below lines in web.config file.

I used the below configuration for log4net. Its logging the errors promptly in debug mode(by F5 in Visual studio). But when I run the exe from the debug folder, its not logging correct information. Please let me know any other config changes required. Thanks in advance

Hi Suman,Log4net is working fine in my windows application but whenever i use same config in Windows service, Rollingappender does not works.ALl logs are written in same file. If you know some thing about this behavior then p;ease reply.

I use log4NET in my web app and all was working correctly .. i used log4net to write a log into a table in my database in MS SQL Server 2005 , but about 4 days ago the log4net stop to do it , when I trace the transactions in the database I found this:

The log4net change my insert query to this :exec sp_execute 1 (values) and the log was working fine , but suddenly change to this:exec sp_execute -1 (values) and stop the write.

Thanks for writing this page, it was very helpful.Log4net samples are so poorely documented, that starting logging can take up to hours . Getting it to work is definately the worst (and maybe only?) problem of log4net.Anyway, once again thanks a lot!

Sir, I have an asp.net application that uses log4net for logging purpose. And i want to integrate my application with the other asp.net application i.e. host application. the problem comes here i want to log both application in two different log files. (This is a integrated environment)How can i solve this , plz help me out.