Logging: Change the default log provider to systemd journal. 25/24125/2
authorMarcin Lis <m.lis@samsung.com>
Tue, 8 Jul 2014 14:17:45 +0000 (16:17 +0200)
committerMarcin Lis <m.lis@samsung.com>
Wed, 9 Jul 2014 15:54:25 +0000 (17:54 +0200)
This change replaces the default logging mechanism in the whole security
manager. The dlog provider is not used anymore and it is also excluded from
being build along with the project. Its sources should stay untouched by now.

To verify, first please install this together with the latest security-tests
package. When installed, run tests:
  # security-manager-tests --output=text

And after that please check for the presence of traces in journal:
  # journalctl --unit=security-manager.service

Please also check for the presence of security-manager-client traces:
  # journalctl /usr/bin/security-manager-tests

Change-Id: I4af35d29a6a61d3a5a0bc4c3508bb872206a2f23
Signed-off-by: Marcin Lis <m.lis@samsung.com>
packaging/security-manager.spec
src/common/CMakeLists.txt
src/dpl/log/include/dpl/log/log.h
src/dpl/log/src/log.cpp
src/dpl/log/src/old_style_log_provider.cpp

index 9ba7890..e9ebbd2 100644 (file)
@@ -10,7 +10,7 @@ Source3:    libsecurity-manager-client.manifest
 Requires(post): smack
 BuildRequires: cmake
 BuildRequires: zip
-BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(dlog)
 BuildRequires: libattr-devel
 BuildRequires: libcap-devel
 BuildRequires: pkgconfig(libsmack)
index f3ce1a4..e62c222 100644 (file)
@@ -4,7 +4,7 @@ SET(COMMON_VERSION ${COMMON_VERSION_MAJOR}.1.0)
 PKG_CHECK_MODULES(COMMON_DEP
     REQUIRED
     libsystemd-journal
-    dlog
+#    dlog
     )
 
 INCLUDE_DIRECTORIES(SYSTEM
@@ -21,7 +21,7 @@ SET(COMMON_SOURCES
     ${COMMON_PATH}/protocols.cpp
     ${COMMON_PATH}/message-buffer.cpp
     ${DPL_PATH}/log/src/abstract_log_provider.cpp
-    ${DPL_PATH}/log/src/dlog_log_provider.cpp
+#    ${DPL_PATH}/log/src/dlog_log_provider.cpp
     ${DPL_PATH}/log/src/sd_journal_provider.cpp
     ${DPL_PATH}/log/src/log.cpp
     ${DPL_PATH}/log/src/old_style_log_provider.cpp
index df8e1ff..206223c 100644 (file)
@@ -90,9 +90,6 @@ class LogSystem :
                   int line,
                   const char *function);
 
-    /**
-     * Set default's DLOG provider Tag
-     */
     void SetTag(const char *tag);
 
     /**
index fd43a2f..fb94ec5 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <dpl/log/log.h>
 #include <dpl/singleton_impl.h>
-#include <dpl/log/dlog_log_provider.h>
+#include <dpl/log/sd_journal_provider.h>
 #include <dpl/log/old_style_log_provider.h>
 
 IMPLEMENT_SINGLETON(SecurityManager::Log::LogSystem)
@@ -109,7 +109,7 @@ LogSystem::LogSystem() :
         }
     }
 
-    // Setup default DLOG and old style logging
+    // Setup default systemd journal and old style logging
     if (oldStyleLogs) {
         // Old style
         AddProvider(new OldStyleLogProvider(oldStyleDebugLogs,
@@ -118,11 +118,11 @@ LogSystem::LogSystem() :
                                             oldStyleErrorLogs,
                                             oldStylePedanticLogs));
     } else {
-        // DLOG
-        AddProvider(new DLOGLogProvider());
+        // Systemd Journal
+        AddProvider(new SdJournalProvider());
     }
 #else // BUILD_TYPE_DEBUG
-    AddProvider(new DLOGLogProvider());
+    AddProvider(new SdJournalProvider());
 #endif // BUILD_TYPE_DEBUG
 }
 
index d302131..a88a2b1 100644 (file)
@@ -27,7 +27,6 @@
 #include <sstream>
 #include <sys/time.h>
 #include <unistd.h>
-#include <dlog.h>
 
 namespace SecurityManager {
 namespace Log {