]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/main.c
Import ITS#2007 and ITS#2009 bug fixes from HEAD
[openldap] / servers / slapd / main.c
index cea889cf7adfc9c38a657b481e40f431b4929b54..de931e49088dd0318cf6b010e6556abb2f6b8520 100644 (file)
@@ -177,8 +177,10 @@ int main( int argc, char **argv )
                {
                        slap_debug = *i;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                                  "main: new debug level from registry is: %d\n", slap_debug ));
+                       lutil_log_initialize( argc, argv );
+                       LDAP_LOG( SLAPD, INFO, 
+                               "main: new debug level from registry is: %d\n", 
+                               slap_debug, 0, 0 );
 #else
                        Debug( LDAP_DEBUG_ANY, "new debug level from registry is: %d\n", slap_debug, 0, 0 );
 #endif
@@ -192,8 +194,8 @@ int main( int argc, char **argv )
 
                    urls = ch_strdup(newUrls);
 #ifdef NEW_LOGGING
-                   LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                              "main: new urls from registry: %s\n", urls ));
+                   LDAP_LOG( SLAPD, INFO, 
+                               "main: new urls from registry: %s\n", urls, 0, 0 );
 #else
                    Debug(LDAP_DEBUG_ANY, "new urls from registry: %s\n",
                          urls, 0, 0);
@@ -206,8 +208,8 @@ int main( int argc, char **argv )
                {
                        configfile = newConfigFile;
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                                  "main: new config file from registry is: %s\n", configfile ));
+                       LDAP_LOG( SLAPD, INFO, 
+                               "main: new config file from registry is: %s\n", configfile, 0, 0 );
 #else
                        Debug ( LDAP_DEBUG_ANY, "new config file from registry is: %s\n", configfile, 0, 0 );
 #endif
@@ -310,16 +312,15 @@ int main( int argc, char **argv )
 
 #ifdef NEW_LOGGING
        lutil_log_initialize( argc, argv );
-#endif
-
+#else
        lutil_set_debug_level( "slapd", slap_debug );
        ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &slap_debug);
        ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &slap_debug);
        ldif_debug = slap_debug;
+#endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                  "%s", Versionstr ));
+       LDAP_LOG( SLAPD, INFO, "%s", Versionstr, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "%s", Versionstr, 0, 0 );
 #endif
@@ -384,8 +385,7 @@ int main( int argc, char **argv )
 
        if ( slap_schema_init( ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: schema initialization error\n" ));
+               LDAP_LOG( OPERATION, CRIT, "main: schema initialization error\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "schema initialization error\n",
@@ -424,8 +424,7 @@ int main( int argc, char **argv )
 
        if ( glue_sub_init( ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: subordinate config error\n"));
+               LDAP_LOG( SLAPD, CRIT, "main: subordinate config error\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "subordinate config error\n",
@@ -436,8 +435,7 @@ int main( int argc, char **argv )
 
        if ( slap_schema_check( ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: schema prep error\n"));
+               LDAP_LOG( SLAPD, CRIT, "main: schema prep error\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "schema prep error\n",
@@ -451,8 +449,7 @@ int main( int argc, char **argv )
        rc = ldap_pvt_tls_init();
        if( rc != 0) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: tls init failed: %d\n", rc ));
+               LDAP_LOG( SLAPD, CRIT, "main: tls init failed: %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "main: TLS init failed: %d\n",
@@ -466,8 +463,7 @@ int main( int argc, char **argv )
        rc = ldap_pvt_tls_init_def_ctx();
        if( rc != 0) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                          "main: tls init def ctx failed: %d\n", rc ));
+               LDAP_LOG( SLAPD, CRIT, "main: tls init def ctx failed: %d\n", rc, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                    "main: TLS init def ctx failed: %d\n",
@@ -516,8 +512,7 @@ int main( int argc, char **argv )
                FILE *fp;
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
-                          "main: slapd starting.\n" ));
+               LDAP_LOG( SLAPD, INFO, "main: slapd starting.\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 );
 #endif
@@ -575,8 +570,7 @@ stop:
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
-                  "main: slapd stopped.\n" ));
+       LDAP_LOG( SLAPD, CRIT, "main: slapd stopped.\n", 0, 0, 0 );
 #else
        Debug( LDAP_DEBUG_ANY, "slapd stopped.\n", 0, 0, 0 );
 #endif