added database logging
added database example credentials
require mysql
Renamed onEvent to logEvent
fixed syntax errors
added logging events