summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2006-06-21 20:48:49 +0000
committerHenri Herscher <henri@oreka.org>2006-06-21 20:48:49 +0000
commit77a00908352320ba499b2760e709c2313c1df292 (patch)
treed03428f2c6e6e09a7f62b5cdec0ac908d03c207b
parent16f4673e5e8bf90d6eacd435a663a415eab93460 (diff)
Moving LogManager.cpp to orkbasecxx
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@279 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r--orkbasecxx/LogManager.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/orkbasecxx/LogManager.cpp b/orkbasecxx/LogManager.cpp
new file mode 100644
index 0000000..3092f85
--- /dev/null
+++ b/orkbasecxx/LogManager.cpp
@@ -0,0 +1,58 @@
+/*
+ * Oreka -- A media capture and retrieval platform
+ *
+ * Copyright (C) 2005, orecx LLC
+ *
+ * http://www.orecx.com
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License.
+ * Please refer to http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
+
+#include "LogManager.h"
+#include <log4cxx/propertyconfigurator.h>
+#include <log4cxx/basicconfigurator.h>
+#include <log4cxx/logmanager.h>
+
+void OrkLogManager::Initialize()
+{
+ BasicConfigurator::configure();
+
+ char* logCfgFilename = "";
+ FILE* file = ACE_OS::fopen("logging.properties", "r");
+ if(file)
+ {
+ // logging.properties exists in the current directory
+ logCfgFilename = "logging.properties";
+ fclose(file);
+ }
+ else
+ {
+ // logging.properties could not be found in the current directory, try to find it in system configuration directory
+ logCfgFilename = "/etc/orkaudio/logging.properties";
+ }
+
+ // If this one fails, the above default configuration stays valid
+ PropertyConfigurator::configure(logCfgFilename);
+
+ rootLog = Logger::getLogger("root");
+ topLog = Logger::getLogger("top");
+ immediateProcessingLog = Logger::getLogger("immediateProcessing");
+ batchProcessingLog = Logger::getLogger("batchProcessing");
+ portLog = Logger::getLogger("port");
+ fileLog = Logger::getLogger("file");
+ reportingLog = Logger::getLogger("reporting");
+ configLog = Logger::getLogger("config");
+ tapelistLog = Logger::getLogger("tapelist");
+ tapeLog = Logger::getLogger("tape");
+}
+
+void OrkLogManager::Shutdown()
+{
+ log4cxx::LogManager::shutdown();
+}
+