Refactoring in Log class

Use DBConnection class,
use methods of log class in cron jobs