From 37a77d6960db1339682d4f025bd36919c4f679b8 Mon Sep 17 00:00:00 2001 From: jmagne Date: Mon, 1 Aug 2011 23:41:04 +0000 Subject: Fix Bugzilla Bug# 725572 - Starting TPS subsystem with no pre-existing audit log file does not write audit messages. git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@2089 c9f7a03b-bd48-0410-a16d-cbbf54688b0b --- pki/base/tps/src/main/LogFile.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'pki/base/tps/src/main/LogFile.cpp') diff --git a/pki/base/tps/src/main/LogFile.cpp b/pki/base/tps/src/main/LogFile.cpp index e2dec7026..d908ca0c5 100644 --- a/pki/base/tps/src/main/LogFile.cpp +++ b/pki/base/tps/src/main/LogFile.cpp @@ -30,6 +30,7 @@ extern "C" { #endif +#include #include #include #include @@ -98,8 +99,8 @@ void LogFile::shutdown() { m_ctx->LogInfo( "LogFile::shutdown", __LINE__, - "thread = 0x%lx: Logfile %s shutting down", - PR_GetCurrentThread(), m_fname); + "thread = 0x%lx: Logfile %s shutting down pid: %d", + PR_GetCurrentThread(), m_fname,getpid()); PR_EnterMonitor(m_monitor); if (m_fd != NULL) { @@ -124,13 +125,20 @@ int LogFile::open() { PRFileInfo info; PR_EnterMonitor(m_monitor); + + m_ctx->LogInfo( "LogFile::open", + __LINE__, + "Opening Log File: %s pid: %d", + m_fname,getpid()); + if (m_fd == NULL) { m_fd = PR_Open(m_fname, PR_RDWR | PR_CREATE_FILE | PR_APPEND, 440|200); if (m_fd == NULL) { m_ctx->LogError( "LogFile::open", __LINE__, - "Unable to open log file %s", - m_fname); + "Unable to open log file %s error no: %d", + m_fname,PR_GetError()); + goto loser; } -- cgit