Save logs in database

hello guys ,
i want to save logs in database instead of log file,.
i found Log class and log method that writes into log file ,
how can i use it to insert to database? tnx very much .

Please have a look at this class:

Within the config.php you can setup the class which shall be used for logging.

i've done it with editing log method in , lib/Log.php class ,
thank you so much.
the most important part , was decoding exceptions to real string .
BTW , everything is now awesome .