]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
dout: Reopen dout after parsing all config opts
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 2 Mar 2011 15:28:10 +0000 (07:28 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 2 Mar 2011 15:29:01 +0000 (07:29 -0800)
Reopen the dout stream only after we parse all configuration options.
Specifying --log-file on the command line now works as expected.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/common/common_init.cc

index eaf9c6a8a26b6a9951e1c17ca114f2ff6da3a1b0..7683787c812b18a763f65d9f8a1a5092bdeb2f06 100644 (file)
@@ -154,14 +154,6 @@ void common_init(std::vector<const char*>& args, const char *module_type, int fl
   if (force_fg_logging)
     set_foreground_logging();
 
-  {
-    // In the long term, it would be best to ensure that we read ceph.conf
-    // before initializing dout(). For now, just force a reopen here with the
-    // configuration we have just read.
-    DoutLocker _dout_locker;
-    _dout_open_log();
-  }
-
   if (g_conf.daemonize)
     cout << ceph_version_to_string() << std::endl;
 
@@ -175,6 +167,15 @@ void common_init(std::vector<const char*>& args, const char *module_type, int fl
 #endif
 
   parse_config_options(args);
+
+  {
+    // In the long term, it would be best to ensure that we read ceph.conf
+    // before initializing dout(). For now, just force a reopen here with the
+    // configuration we have just read.
+    DoutLocker _dout_locker;
+    _dout_open_log();
+  }
+
   install_standard_sighandlers();
 
 #ifdef HAVE_LIBTCMALLOC