Added code to log pugs to the database