Dodgy database logging