]> git.sur5r.net Git - openldap/commitdiff
added new logging to back-meta
authorPierangelo Masarati <ando@openldap.org>
Sun, 13 May 2001 23:44:22 +0000 (23:44 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 13 May 2001 23:44:22 +0000 (23:44 +0000)
12 files changed:
servers/slapd/back-meta/add.c
servers/slapd/back-meta/back-meta.h
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/compare.c
servers/slapd/back-meta/config.c
servers/slapd/back-meta/conn.c
servers/slapd/back-meta/delete.c
servers/slapd/back-meta/group.c
servers/slapd/back-meta/modify.c
servers/slapd/back-meta/modrdn.c
servers/slapd/back-meta/search.c
servers/slapd/back-meta/unbind.c

index 4f50305de05bf3c9602c386562d39eedad2a3302..1d5b0952343c45577f646fda2c92c638c0bf979e 100644 (file)
@@ -91,6 +91,13 @@ meta_back_add(
        LDAPMod **attrs;
        char *mdn = NULL, *mapped;
 
+#ifdef NEW_LOGGING
+       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, "meta_back_add: %s\n",
+                       e->e_dn ));
+#else /* !NEW_LOGGING */
+       Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n", e->e_dn, 0, 0);
+#endif /* !NEW_LOGGING */
+
        /*
         * get the current connection
         */
@@ -109,15 +116,25 @@ meta_back_add(
                if ( mdn == NULL ) {
                        mdn = e->e_dn;
                }
+
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                               "[rw] addDn: \"%s\" -> \"%s\"\n",
+                               e->e_dn, mdn ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> addDn: \"%s\" -> \"%s\"\n%s", 
                                e->e_dn, mdn, "" );
+#endif /* !NEW_LOGGING */
                break;
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                NULL, "Unwilling to perform", NULL, NULL );
+               return -1;
                
        case REWRITE_REGEXEC_ERR:
+               send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+                               NULL, "Operations error", NULL, NULL );
                return -1;
        }
 
index 5d0c433ce3111194be3d22497f08d7d2f32c5949..4d3689f0ebae491ed37d1e58a4b91999683b63a0 100644 (file)
@@ -144,7 +144,6 @@ struct metainfo {
 
 extern int
 meta_back_do_single_bind(
-               Operation               *op,
                struct metainfo         *li,
                struct metaconn         *lc,
                const char              *dn,
index 219e8b96d766db25e8f24ba05af58fab5133f9ea..6d0f35b0117324f5e2944159868a873fee0397f6 100644 (file)
@@ -96,7 +96,7 @@ meta_back_bind(
 
 #ifdef NEW_LOGGING
        LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                               "meta_back_bind: dn: %s.\n", dn ));
+                       "meta_back_bind: dn: %s.\n", dn ));
 #else /* !NEW_LOGGING */
        Debug( LDAP_DEBUG_ARGS, "meta_back_bind: dn: %s.\n%s%s", dn, "", "" );
 #endif /* !NEW_LOGGING */
@@ -108,7 +108,8 @@ meta_back_bind(
        if ( !lc ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "backend", LDAP_LEVEL_NOTICE,
-                               "meta_back_bind: no target for dn %s.\n", dn ));
+                               "meta_back_bind: no target for dn %s.\n",
+                               dn ));
 #else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ANY,
                                "meta_back_bind: no target for dn %s.\n%s%s",
@@ -140,16 +141,20 @@ meta_back_bind(
                         */
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_WARNING,
-"==>meta_back_bind: more that one candidate is attempting to bind ...%s%s%s\n" ));
+                                       "==>meta_back_bind: more than one"
+                                       " candidate is attempting to bind"
+                                       " ...\n" ));
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ANY,
-"==>meta_back_bind: more that one candidate is attempting to bind ...%s%s%s\n", 
-                               "", "", "" );
+                                       "==>meta_back_bind: more than one"
+                                       " candidate is attempting to bind"
+                                       " ...\n%s%s%s", 
+                                       "", "", "" );
 #endif /* !NEW_LOGGING */
                }
 
 
-               lerr = meta_back_do_single_bind( op, li, lc, dn, ndn, cred,
+               lerr = meta_back_do_single_bind( li, lc, dn, ndn, cred,
                                method, i );
                if ( lerr != LDAP_SUCCESS ) {
                        err = lerr;
@@ -178,7 +183,6 @@ meta_back_bind(
  */
 int
 meta_back_do_single_bind(
-               Operation               *op,
                struct metainfo         *li,
                struct metaconn         *lc,
                const char              *dn,
@@ -200,19 +204,21 @@ meta_back_do_single_bind(
                if ( mdn == NULL ) {
                        mdn = ( char * )dn;
                }
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                               "[rw] bindDn: \"%s\" -> \"%s\"\n", dn, mdn ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                                "rw> bindDn: \"%s\" -> \"%s\"\n%s",
                                dn, mdn, "" );
+#endif /* !NEW_LOGGING */
                break;
                
        case REWRITE_REGEXEC_UNWILLING:
-               send_ldap_result( lc->conn, op, LDAP_UNWILLING_TO_PERFORM,
-                               NULL, "Unwilling to perform",
-                               NULL, NULL );
-               /* continues to next case */
+               return LDAP_UNWILLING_TO_PERFORM;
 
        case REWRITE_REGEXEC_ERR:
-               return -1;
+               return LDAP_OPERATIONS_ERROR;
        }
 
        rc = ldap_bind_s( lc->conns[ candidate ]->ld, mdn,
@@ -274,14 +280,20 @@ meta_back_dobind( struct metaconn *lc, Operation *op )
                                NULL, LDAP_AUTH_SIMPLE );
                if ( rc != LDAP_SUCCESS ) {
                        
-                       /*
-                        * This way, the first bind error would be fatal ...
-                        */
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_LEVEL_WARNING,
+                                       "meta_back_dobind: (anonymous)"
+                                       " bind as \"%s\" failed"
+                                       " with error \"%s\"\n",
+                                       lsc[ 0 ]->bound_dn,
+                                       ldap_err2string( rc ) ));
+#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ANY,
        "==>meta_back_dobind: (anonymous) bind as \"%s\" failed"
        " with error \"%s\"\n%s",
                                lsc[ 0 ]->bound_dn,
                                ldap_err2string( rc ), "" );
+#endif /* !NEW_LOGGING */
 
                        /*
                         * null cred bind should always succeed
@@ -334,11 +346,20 @@ meta_back_op_result( struct metaconn *lc, Operation *op )
                        send_ldap_result( lc->conn, op, err, match, msg,
                                        NULL, NULL );
                        
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_DEBUG_NOTICE,
+                                               "meta_back_op_result: target"
+                                               " <%d> sending msg \"%s\""
+                                               " (matched \"%s\")\n",
+                                               i, ( msg ? msg : "" ),
+                                               ( match ? match : "" ) ));
+#else /* !NEW_LOGGING */
                        Debug(LDAP_DEBUG_ANY,
 "==> meta_back_op_result: target <%d> sending msg \"%s\" (matched \"%s\")\n", 
                                i,
                                ( msg ? msg : "" ),
                                ( match ? match : "" ) );
+#endif /* !NEW_LOGGING */
 
                        /* better test the pointers before freeing? */
                        if ( match ) {
index 9ba3ac29368360afe2fc82be0fbd0719254edaad..9b0e9a43f70fcd26aeeb27005c6e7f4e176fdb73 100644 (file)
@@ -124,17 +124,27 @@ meta_back_compare(
                        if ( mdn == NULL ) {
                                mdn = ( char * )dn;
                        }
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                       "[rw] compareDn: \"%s\" -> \"%s\"\n",
+                                       dn, mdn ));
+#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS,
                                        "rw> compareDn: \"%s\" -> \"%s\"\n%s",
                                        dn, mdn, "" );
+#endif /* !NEW_LOGGING */
                        break;
                
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                        NULL, "Unwilling to perform",
                                        NULL, NULL );
+                       return -1;
                        
                case REWRITE_REGEXEC_ERR:
+                       send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+                                       NULL, "Operations error",
+                                       NULL, NULL );
                        return -1;
                }
 
@@ -301,9 +311,15 @@ finish:
                        if ( mmatch == NULL ) {
                                mmatch = ( char * )match;
                        }
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                       "[rw] matchedDn: \"%s\" -> \"%s\"\n",
+                                       match, mmatch ));
+#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:"
                                        " \"%s\" -> \"%s\"\n%s",
                                        match, mmatch, "" );
+#endif /* !NEW_LOGGING */
                        break;
                        
                
@@ -311,15 +327,21 @@ finish:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                        NULL, "Unwilling to perform",
                                        NULL, NULL );
-                       /* continue to the next case */
+                       rc = -1;
+                       goto cleanup;
                        
                case REWRITE_REGEXEC_ERR:
+                       send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+                                       NULL, "Operations error",
+                                       NULL, NULL );
                        rc = -1;
-                       break;
+                       goto cleanup;
                }
-       }       
+       }
+
        send_ldap_result( conn, op, rres, mmatch, err, NULL, NULL );
 
+cleanup:
        if ( match != NULL ) {
                if ( mmatch != match ) {
                        free( mmatch );
index 7c449b200ecc81c2b9ee31a32227d84ad95018fa..c6783247a8b6b9fbd43369f7ccd09323917f552a 100644 (file)
@@ -251,10 +251,18 @@ meta_back_db_config(
                
                ldap_free_urldesc( ludp );
 
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                               "meta_back_db_config:"
+                               " URI \"%s\", suffix \"%s\"\n",
+                               li->targets[ i ]->uri,
+                               li->targets[ i ]->suffix ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_CONFIG,
-       "==>meta_back_db_config: URI \"%s\", suffix \"%s\"%s\n",
+       "==>meta_back_db_config: URI \"%s\", suffix \"%s\"\n%s",
                        li->targets[ i ]->uri, li->targets[ i ]->suffix, "" );
-
+#endif /* !NEW_LOGGING */
+               
        /* default target directive */
        } else if ( strcasecmp( argv[ 0 ], "default-target" ) == 0 ) {
                int i = li->ntargets-1;
index cf440dec0890aff16c67547f14c313660204d152..f840eeff15ab3241aaf843136943488cec454ac2 100644 (file)
@@ -292,9 +292,15 @@ init_one_conn(
                        if ( lsc->bound_dn == NULL ) {
                                lsc->bound_dn = ch_strdup( conn->c_cdn );
                        }
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                       "[rw] bindDn: \"%s\" -> \"%s\"\n",
+                                       conn->c_cdn, lsc->bound_dn ));
+#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS,
                                        "rw> bindDn: \"%s\" -> \"%s\"\n%s",
                                        conn->c_cdn, lsc->bound_dn, "" );
+#endif /* !NEW_LOGGING */
                        break;
                        
                case REWRITE_REGEXEC_UNWILLING:
@@ -393,11 +399,16 @@ meta_back_getconn(
                        return NULL;
                }
                                
-
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+                               "meta_back_getconn: got target %d"
+                               " for ndn=\"%s\" from cache\n", i, ndn ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_CACHE,
        "==>meta_back_getconn: got target %d for ndn=\"%s\" from cache\n%s",
                                i, ndn, "" );
-                       
+#endif /* !NEW_LOGGING */
+
                /*
                 * Clear all other candidates
                 */
@@ -477,9 +488,15 @@ meta_back_getconn(
                
                ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
 
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+                               "meta_back_getconn: conn %ld inserted\n",
+                               lc->conn->c_connid ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>meta_back_getconn: conn %ld inserted\n%s%s",
                        lc->conn->c_connid, "", "" );
+#endif /* !NEW_LOGGING */
                
                /*
                 * Err could be -1 in case a duplicate metaconn is inserted
@@ -491,9 +508,15 @@ meta_back_getconn(
                        return NULL;
                }
        } else {
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+                               "meta_back_getconn: conn %ld fetched\n",
+                               lc->conn->c_connid ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>meta_back_getconn: conn %ld fetched\n%s%s",
                        lc->conn->c_connid, "", "" );
+#endif /* !NEW_LOGGING */
        }
        
        return lc;
index 1acde0b198d61f41a847cfac9138b02c041385bb..4c22ac89e2b73aeeabf9658f51473872e0fe3486 100644 (file)
@@ -105,16 +105,25 @@ meta_back_delete(
                if ( mdn == NULL ) {
                        mdn = ( char * )dn;
                }
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                               "[rw] deleteDn: \"%s\" -> \"%s\"\n",
+                               dn, mdn ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> deleteDn: \"%s\" -> \"%s\"\n%s",
                                dn, mdn, "" );
+#endif /* !NEW_LOGGING */
                break;
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                NULL, "Unwilling to perform", NULL, NULL );
+               return -1;
 
        case REWRITE_REGEXEC_ERR:
-               return( -1 );
+               send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+                               NULL, "Operations error", NULL, NULL );
+               return -1;
        }
        
        ldap_delete_s( lc->conns[ candidate ]->ld, mdn );
index 1fe9d6eff7e028ea5221626e0d4520fe02073b1f..7b354a13cc9bd18e8d3dff9791697c9f96bae45f 100644 (file)
@@ -167,10 +167,17 @@ meta_back_group(
                if ( mop_ndn == NULL ) {
                        mop_ndn = ( char * )op_ndn;
                }
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                               "[rw] bindDn (op ndn in group):"
+                                \"%s\" -> \"%s\"\n",
+                                op_ndn, mop_ndn ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                                "rw> bindDn (op ndn in group):"
                                " \"%s\" -> \"%s\"\n%s",
                                op_ndn, mop_ndn, "" );
+#endif /* !NEW_LOGGING */
                break;
                
        case REWRITE_REGEXEC_UNWILLING:
@@ -190,10 +197,17 @@ meta_back_group(
                if ( mgr_ndn == NULL ) {
                        mgr_ndn = ( char * )gr_ndn;
                }
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                               "[rw] searchBase (gr ndn in group):"
+                               " \"%s\" -> \"%s\"\n",
+                               gr_ndn, mgr_ndn ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS,
                                "rw> searchBase (gr ndn in group):"
                                " \"%s\" -> \"%s\"\n%s",
                                gr_ndn, mgr_ndn, "" );
+#endif /* !NEW_LOGGING */
                break;
                
        case REWRITE_REGEXEC_UNWILLING:
index 10cda0b78fbe9356898b6efd3045ab96b4d09832..a2530a4c08930227de35c1bd8e0ecb78f297aa48 100644 (file)
@@ -108,16 +108,25 @@ meta_back_modify(
                if ( mdn == NULL ) {
                        mdn = ( char * )dn;
                }
-               Debug( LDAP_DEBUG_ARGS, "rw> modifyDN: \"%s\" -> \"%s\"\n%s",
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                               "[rw] modifyDn: \"%s\" -> \"%s\"\n",
+                               dn, mdn ));
+#else /* !NEW_LOGGING */
+               Debug( LDAP_DEBUG_ARGS, "rw> modifyDn: \"%s\" -> \"%s\"\n%s",
                                dn, mdn, "" );
+#endif /* !NEW_LOGGING */
                break;
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                NULL, "Unwilling to perform", NULL, NULL );
+               return -1;
 
        case REWRITE_REGEXEC_ERR:
-               return( -1 );
+               send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+                               NULL, "Operations error", NULL, NULL );
+               return -1;
        }
 
        for ( i = 0, ml = modlist; ml; i++ ,ml = ml->sml_next )
index c4929f2f4a2a89de92b0eb95549e04af9db27be2..16b6e7691b76de73eb69173f4c1e81ec6c65fe93 100644 (file)
@@ -137,18 +137,29 @@ meta_back_modrdn(
                        if ( mnewSuperior == NULL ) {
                                mnewSuperior = ( char * )newSuperior;
                        }
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                       "[rw] newSuperiorDn:"
+                                       " \"%s\" -> \"%s\"\n",
+                                       newSuperior, mnewSuperior ));
+#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> newSuperiorDn:"
                                        " \"%s\" -> \"%s\"\n%s",
                                        newSuperior, mnewSuperior, "" );
+#endif /* !NEW_LOGGING */
                        break;
 
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                        NULL, "Unwilling to perform",
                                        NULL, NULL );
+                       return -1;
 
                case REWRITE_REGEXEC_ERR:
-                       return( -1 );
+                       send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+                                       NULL, "Operations error",
+                                       NULL, NULL );
+                       return -1;
                }
        }
 
@@ -161,16 +172,25 @@ meta_back_modrdn(
                if ( mdn == NULL ) {
                        mdn = ( char * )dn;
                }
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                               "[rw] modrDn: \"%s\" -> \"%s\"\n",
+                               dn, mdn ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> modrDn: \"%s\" -> \"%s\"\n%s",
                                dn, mdn, "" );
+#endif /* !NEW_LOGGING */
                break;
                
        case REWRITE_REGEXEC_UNWILLING:
                send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                NULL, "Unwilling to perform", NULL, NULL );
+               return -1;
 
        case REWRITE_REGEXEC_ERR:
-               return( -1 );
+               send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+                               NULL, "Operations error", NULL, NULL );
+               return -1;
        }
 
        ldap_rename2_s( lc->conns[ candidate ]->ld, mdn, newrdn,
@@ -185,3 +205,4 @@ meta_back_modrdn(
        
        return meta_back_op_result( lc, op );
 }
+
index 5286128cce875c56486709b1caa1b8e7760b8771..6c7a5ca37c448d21c01a958039315cbe2621947d 100644 (file)
@@ -217,17 +217,27 @@ meta_back_search(
                if ( mbase == NULL ) {
                        mbase = realbase;
                }
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                               "[rw] searchBase: \"%s\" -> \"%s\"\n",
+                               base, mbase ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_ARGS, "rw> searchBase: \"%s\" -> \"%s\"\n%s",
                                base, mbase, "" );
+#endif /* !NEW_LOGGING */
                break;
                
                case REWRITE_REGEXEC_UNWILLING:
                        send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
                                        NULL, "Unwilling to perform",
                                        NULL, NULL );
-                       /* continue to the next case */
+                       rc = -1;
+                       goto finish;
 
                case REWRITE_REGEXEC_ERR:
+                       send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+                                       NULL, "Operations error",
+                                       NULL, NULL );
                        rc = -1;
                        goto finish;
                }
@@ -245,9 +255,15 @@ meta_back_search(
                                }
                                mfilter = ( char * )filterstr;
                        }
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                       "[rw] searchFilter: \"%s\" -> \"%s\"\n",
+                                       filterstr, mfilter ));
+#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS,
                                "rw> searchFilter: \"%s\" -> \"%s\"\n%s",
                                filterstr, mfilter, "" );
+#endif /* !NEW_LOGGING */
                        break;
                
                case REWRITE_REGEXEC_UNWILLING:
@@ -375,9 +391,16 @@ meta_back_search(
                                ldap_get_option( lsc[ 0 ]->ld,
                                                LDAP_OPT_MATCHED_DN, &match );
 
-                               Debug( LDAP_DEBUG_ARGS,
-       "meta_back_search=> [%d] match=\"%s\" err=\"%s\"\n",
+#ifdef NEW_LOGGING
+                               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+                                               "meta_back_search [%d]"
+                                               " match=\"%s\" err=\"%s\"\n",
+                                               i, match, err ));
+#else /* !NEW_LOGGING */
+                               Debug( LDAP_DEBUG_ANY,
+       "=>meta_back_search [%d] match=\"%s\" err=\"%s\"\n",
                                        i, match, err );        
+#endif /* !NEW_LOGGING */
                                
                                last = i;
                                rc = 0;
@@ -425,9 +448,15 @@ meta_back_search(
                        if ( mmatch == NULL ) {
                                mmatch = ( char * )match;
                        }
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                       "[rw] matchedDn: \"%s\" -> \"%s\"\n",
+                                       match, mmatch ));
+#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:"
                                       " \"%s\" -> \"%s\"\n%s",
                                       match, mmatch, "" );
+#endif /* !NEW_LOGGING */
                        break;
                        
                case REWRITE_REGEXEC_UNWILLING:
@@ -501,8 +530,15 @@ meta_send_entry(
                if ( ent.e_dn == NULL ) {
                        ent.e_dn = dn;
                } else {
+#ifdef NEW_LOGGING
+                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                                       "[rw] searchResult[%d]:"
+                                       " \"%s\" -> \"%s\"\n",
+                                       target, dn, ent.e_dn ));
+#else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ARGS, "rw> searchResult[%d]: \"%s\""
                                        " -> \"%s\"\n", target, dn, ent.e_dn );
+#endif /* !NEW_LOGGING */
                        free( dn );
                        dn = NULL;
                }
@@ -594,18 +630,30 @@ meta_send_entry(
                                char *newval;
 
                                switch ( rewrite_session( li->targets[ target ]->rwinfo,
-                                                       "searchResult", bv->bv_val,
+                                                       "searchResult",
+                                                       bv->bv_val,
                                                        lc->conn, &newval )) {
                                case REWRITE_REGEXEC_OK:
                                        /* left as is */
                                        if ( newval == NULL ) {
                                                break;
                                        }
-                                       Debug( LDAP_DEBUG_ARGS,
-                               "rw> searchResult on attr=%s: \"%s\" -> \"%s\"\n",
-                                               attr->a_desc->ad_type->sat_cname,
+#ifdef NEW_LOGGING
+                                       LDAP_LOG(( "backend",
+                                                       LDAP_LEVEL_DETAIL1,
+                                                       "[rw] searchResult on"
+                                                       " attr=%s:"
+                                                       " \"%s\" -> \"%s\"\n",
+                                       attr->a_desc->ad_type->sat_cname,
+                                                       bv->bv_val, newval ));
+#else /* !NEW_LOGGING */
+                                       Debug( LDAP_DEBUG_ARGS,
+                                               "rw> searchResult on attr=%s:"
+                                               " \"%s\" -> \"%s\"\n",
+                                       attr->a_desc->ad_type->sat_cname,
                                                bv->bv_val, newval );
-
+#endif /* !NEW_LOGGING */
+                                       
                                        free( bv->bv_val );
                                        bv->bv_val = newval;
                                        bv->bv_len = strlen( newval );
index 71086e58a4624371b1a533546d47597dc28d5ed1..c8b3f1f6518b53c173d0d82f5fd04e964ac2effd 100644 (file)
@@ -84,9 +84,15 @@ meta_back_conn_destroy(
        struct metainfo *li = ( struct metainfo * )be->be_private;
        struct metaconn *lc, lc_curr;
 
+#ifdef NEW_LOGGING
+       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
+                       "meta_back_conn_destroy: fetching conn %ld\n",
+                       conn->c_connid ));
+#else /* !NEW_LOGGING */
        Debug( LDAP_DEBUG_TRACE,
                "=>meta_back_conn_destroy: fetching conn %ld\n%s%s",
                conn->c_connid, "", "" );
+#endif /* !NEW_LOGGING */
        
        lc_curr.conn = conn;
        
@@ -98,9 +104,15 @@ meta_back_conn_destroy(
        if ( lc ) {
                int i;
                
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
+                               "meta_back_conn_destroy: destroying conn %ld\n",
+                               lc->conn->c_connid ));
+#else /* !NEW_LOGGING */
                Debug( LDAP_DEBUG_TRACE,
                        "=>meta_back_conn_destroy: destroying conn %ld\n%s%s",
                        lc->conn->c_connid, "", "" );
+#endif /* !NEW_LOGGING */
                
                /*
                 * Cleanup rewrite session