the logger has to be set before entering pidfile_context