split logging into file and database