Writing logs to DB works