Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

log4net: How to store data in DB

I am planning to replace few different logging mechanism with the only 1. Also I would like to store data not in file, but in DB.

For this purpose I am planning to choose log4net. But looking on the documentation I don't see a way to configure it to use DB as logs storage.

Am I missed something? Could you please point me if there is a way to store data in DB using log4net. And how to do that?

Thanks a lot!

like image 669
Budda Avatar asked Nov 29 '10 21:11

Budda


People also ask

Does log4net create directory?

When using a file appender, the destination folder does not have to exist. Log4net creates the folder. Using an administrator account, connect to the Coveo Master server.

Where are log4net logs stored?

You can configure the log4net. config file to create log files. The file is located in the webroot\App_data directory of the installation. The different log files are described in Services logs.

What is rolling file Appender in log4net?

RollingFileAppender can roll log files based on size or date or both depending on the setting of the RollingStyle property. When set to Size the log file will be rolled once its size exceeds the MaximumFileSize.

Is log4net a Threadsafe?

Is log4net thread-safe? Yes, log4net is thread-safe.


1 Answers

There is a good runthrough here:

How to store log in database using log4net

Also the log4net Config Examples show how to setup the config for most databases.

like image 119
D'Arcy Rittich Avatar answered Oct 05 '22 22:10

D'Arcy Rittich