function prototypes for database logging