With a similar requirement, I made a small logging tool (usable as handler) which logs into nearly every DB (including Postgres - thanks to the SQLAlchemy library.) It has BSD license. You may use it (or parts of the code): http://www.reifenberg.de/rrlog/ (It does some more things you may not need, like rotation handling.) Regards, Nebur