Fix logging so that it doesn't conflict with syslog. WIP on database support.