Note that the problematic code is inside if (s->loglevel >= APLOG_DEBUG) { } It seems a simple workaround is lowering the loglevel to something below debug. Production systems won't have loglevel debug in most cases.