

The short answer to your question about over-riding the method is yes, you can. You’ve probably already moved on from your question here, but given that I just had to figure out this problem (found this thread for another purpose), I thought I’d share our solution. Now run the code then you can see the log stored in the database table. Private static readonly log4net.ILog log =(().DeclaringType)

log.Debug(”this text will be in log file”) And do this to write messages in the log file. To use log4net put this as a local class variable: private static readonly log4net.ILog log =(().DeclaringType) Ħ. If you use integrated security then the connection string should be like asĥ. In both cases you need to make sure that the user has access to the, SQL server, the database and the databasetable that Log4Net is going to use. State the username and the password in the connection string.There are two way to define the security part Now put this web.config/app.config file in configuration tag. Add to the project a reference to the \bin\net\2.0\release\log4net.dll assembly in the log4net distribution.Ĥ. Open visual studio and create an application.ģ. For storing log in the database all task are manage by log4net internally.Īt first you need to create a table for Storing log in the SqlServer databaseĢ. One of the best ways to store log in the database using log4net coz it is easy to use and its world wide popularity.
