From 77a00908352320ba499b2760e709c2313c1df292 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Wed, 21 Jun 2006 20:48:49 +0000 Subject: Moving LogManager.cpp to orkbasecxx git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@279 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkbasecxx/LogManager.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 orkbasecxx/LogManager.cpp (limited to 'orkbasecxx') 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 +#include +#include + +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(); +} + -- cgit v1.2.3