https://bugs.openldap.org/show_bug.cgi?id=9507
Issue ID: 9507 Summary: Output when setting LBER_OPT_DEBUG_LEVEL or LDAP_OPT_DEBUG_LEVEL Product: OpenLDAP Version: 2.4.44 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: libraries Assignee: bugs@openldap.org Reporter: john@iastate.edu Target Milestone: ---
I have a web application (cgi) that uses libldap. When I set either of the options LBER_OPT_DEBUG_LEVEL or LDAP_OPT_DEBUG_LEVEL then the library's debug info goes to stderr, which ends in Apache's error_log file rather than my application's log file.
By reading the code, I discovered that I can do:
extern int ber_pvt_err_file;
ber_pvt_err_file = getMyLogFP();
and redirect the output where I want it. This is, of course, fragile. So, I would like to suggest the addition of something like:
FILE * fp = getYourDesiredFP(); ldap_set_option(NULL, LDAP_OPT_DEBUG_FILE, &fp); <and> ber_set_option(NULL, LBER_OPT_DEBUG_FILE, &fp);