Implemented PostgreSQL logging