Date: Monday, May 7, 2007 @ 19:16:06
  Author: marc
    Path: /cvsroot/carob/libmysequoia/src

Modified: MySQLAPI.cpp (1.74 -> 1.75)

Now logging where logger.conf config file was found. Falling back on
default log4cxx console logging when none found.


--------------+
 MySQLAPI.cpp |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)


Index: libmysequoia/src/MySQLAPI.cpp
diff -u libmysequoia/src/MySQLAPI.cpp:1.74 libmysequoia/src/MySQLAPI.cpp:1.75
--- libmysequoia/src/MySQLAPI.cpp:1.74  Fri May  4 15:22:11 2007
+++ libmysequoia/src/MySQLAPI.cpp       Mon May  7 19:16:06 2007
@@ -178,8 +178,10 @@
   StringBuffer sbuf;
     
   // initialize logging 
+
   if (home_dir && !found)
   {
+    // $HOME/.logger.conf
     s = std::string(home_dir) + "/." + LOGGER_CONFIG_FILE;
     std::ifstream f(s.c_str());
     if (f)
@@ -188,6 +190,7 @@
 
   if (conf_dir && !found)
   {
+    // $LIBMYSEQUOIA_CONF_DIR/logger.conf
     s = std::string(conf_dir) + "/" + LOGGER_CONFIG_FILE;
     std::ifstream f(s.c_str());
     if (f)
@@ -195,11 +198,25 @@
   }
   
   if (!found)
+  {
+    // #CONFIGFILE_DIR/logger.conf (typically /etc/mysequoia/logger.conf)
     s = std::string(DEFAULT_LOGGER_CONFIG_FILE);
+    std::ifstream f(s.c_str());
+    if (f)
+      found = true;
+  }
+
+
+  if (!found)
+  {
+    BasicConfigurator::configure();
+    LOG4CXX_WARN(logger, "Could not find a logger.conf file anywhere, logging 
on the console");
+  } else {
+    sbuf << s.c_str();
+    PropertyConfigurator::configure(sbuf.str());
+    LOG4CXX_INFO(logger, "logger configured using " << s);
+  }
 
-  sbuf << s.c_str();
-  PropertyConfigurator::configure(sbuf.str());
-  
   
   LOG4CXX_DEBUG(logger, "Entering mysql_server_init: argc=" << argc << " 
argv=" << argv << " groups=" << groups);
   

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to