@@ -37,7 +37,7 @@ static const char *redirectionio_set_show_rule_ids(cmd_parms *cmd, void *cfg, co
3737static const char * redirectionio_set_server (cmd_parms * cmd , void * dc , int argc , char * const argv []);
3838static const char * redirectionio_set_header (cmd_parms * cmd , void * cfg , const char * arg1 , const char * arg2 );
3939static const char * redirectionio_set_trusted_proxies (cmd_parms * cmd , void * cfg , const char * arg );
40- static void redirectionio_apache_log_callback ( const char * log_str , const void * data , short level );
40+ static const char * redirectionio_trace_enable ( cmd_parms * cmd , void * cfg );
4141static apr_status_t redirectionio_atoi (const char * line , apr_size_t len );
4242
4343static const command_rec redirectionio_directives [] = {
@@ -49,6 +49,7 @@ static const command_rec redirectionio_directives[] = {
4949 AP_INIT_TAKE1 ("redirectionioRuleIdsHeader" , redirectionio_set_show_rule_ids , NULL , OR_ALL , "Show rule ids used on response header" ),
5050 AP_INIT_TAKE2 ("redirectionioSetHeader" , redirectionio_set_header , NULL , OR_ALL , "Add header to match in redirectionio request" ),
5151 AP_INIT_TAKE1 ("redirectionioTrustedProxies" , redirectionio_set_trusted_proxies , NULL , OR_ALL , "Trusted proxies to filter client ip" ),
52+ AP_INIT_NO_ARGS ("redirectionioTraceEnable" , redirectionio_trace_enable , NULL , OR_ALL , "Enable trace for redirectionio" ),
5253 { NULL }
5354};
5455
@@ -144,9 +145,6 @@ static int redirectionio_match_handler(request_rec *r) {
144145 return DECLINED ;
145146 }
146147
147- // Init logging
148- redirectionio_log_init_with_callback (redirectionio_apache_log_callback , r );
149-
150148 // Ask for redirection
151149 if (redirectionio_protocol_match (conn , ctx , r , config -> project_key ) != APR_SUCCESS ) {
152150 redirectionio_invalidate_connection (conn , config , r -> pool );
@@ -879,12 +877,10 @@ static const char *redirectionio_set_trusted_proxies(cmd_parms *cmd, void *cfg,
879877 return NULL ;
880878}
881879
882- static void redirectionio_apache_log_callback (const char * log_str , const void * data , short level ) {
883- if (level <= 1 ) {
884- ap_log_rerror (APLOG_MARK , APLOG_ERR , 0 , (request_rec * )data , "mod_redirectionio api error: %s" , log_str );
885- }
880+ static const char * redirectionio_trace_enable (cmd_parms * cmd , void * cfg ) {
881+ redirectionio_trace_init ();
886882
887- free (( char * ) log_str ) ;
883+ return NULL ;
888884}
889885
890886static apr_status_t redirectionio_atoi (const char * line , apr_size_t len ) {
0 commit comments