You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2014/08/11 16:23:01 UTC
svn commit: r1617293 - in /qpid/trunk/qpid/cpp/src/qpid: broker/Broker.cpp
broker/Broker.h broker/Daemon.cpp linearstore/JournalImpl.cpp
linearstore/MessageStoreImpl.cpp linearstore/journal/EmptyFilePoolManager.cpp
Author: aconway
Date: Mon Aug 11 14:23:01 2014
New Revision: 1617293
URL: http://svn.apache.org/r1617293
Log:
NO-JIRA: Clean up excessive "notice" level log messages, add start-up/shut-down messages.
- Demote excessive "notice" level log messages to "info"
- Provide clear notice "start-up/shut-down" messages at start and end of broker log.
- Log broker PID in start-up/shut-down messages.
Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h
qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp
qpid/trunk/qpid/cpp/src/qpid/linearstore/JournalImpl.cpp
qpid/trunk/qpid/cpp/src/qpid/linearstore/MessageStoreImpl.cpp
qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp?rev=1617293&r1=1617292&r2=1617293&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp Mon Aug 11 14:23:01 2014
@@ -209,6 +209,13 @@ framing::FieldTable noReplicateArgs() {
}
}
+Broker::LogPrefix::LogPrefix() :
+ std::string(Msg() << "Broker (pid=" << sys::SystemInfo::getProcessId() << ") ") {
+ QPID_LOG(notice, *this << "start-up");
+}
+
+Broker::LogPrefix::~LogPrefix() { QPID_LOG(notice, *this << "shut-down"); }
+
Broker::Broker(const BrokerOptions& conf) :
poller(new Poller),
timer(new qpid::sys::Timer),
@@ -236,10 +243,8 @@ Broker::Broker(const BrokerOptions& conf
queueCleaner(queues, poller, timer.get()),
recoveryInProgress(false),
timestampRcvMsgs(conf.timestampRcvMsgs),
- logPrefix(Msg() << "Broker " << sys::SystemInfo::getProcessId()),
getKnownBrokers(boost::bind(&Broker::getKnownBrokersImpl, this))
{
- QPID_LOG(notice, logPrefix << " initializing");
if (!dataDir.isEnabled()) {
QPID_LOG (info, "No data directory - Disabling persistent configuration");
}
@@ -386,11 +391,12 @@ Broker::Broker(const BrokerOptions& conf
knownBrokers.push_back(Url(conf.knownHosts));
}
- } catch (const std::exception&) {
+ } catch (const std::exception& e) {
+ QPID_LOG(critical, logPrefix << "start-up failed: " << e.what());
finalize();
throw;
}
- QPID_LOG(notice, logPrefix << " initialized");
+ QPID_LOG(info, logPrefix << "initialized");
}
void Broker::declareStandardExchange(const std::string& name, const std::string& type)
@@ -502,7 +508,7 @@ void Broker::setStore () {
void Broker::run() {
if (config.workerThreads > 0) {
- QPID_LOG(notice, logPrefix << " running");
+ QPID_LOG(info, logPrefix << "running");
Dispatcher d(poller);
int numIOThreads = config.workerThreads;
std::vector<Thread> t(numIOThreads-1);
@@ -518,7 +524,7 @@ void Broker::run() {
for (int i=0; i<numIOThreads-1; ++i) {
t[i].join();
}
- QPID_LOG(notice, logPrefix << " stopped");
+ QPID_LOG(info, logPrefix << "stopped");
} else {
throw Exception((boost::format("Invalid value for worker-threads: %1%") % config.workerThreads).str());
}
@@ -532,7 +538,7 @@ void Broker::shutdown() {
}
Broker::~Broker() {
- QPID_LOG(notice, logPrefix << " shutting down");
+ QPID_LOG(info, logPrefix << "shutting down");
if (mgmtObject != 0)
mgmtObject->debugStats("destroying");
shutdown();
@@ -541,7 +547,6 @@ Broker::~Broker() {
SaslAuthenticator::fini();
timer->stop();
managementAgent.reset();
- QPID_LOG(notice, logPrefix << " shutdown complete");
}
ManagementObject::shared_ptr Broker::GetManagementObject(void) const
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h?rev=1617293&r1=1617292&r2=1617293&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Broker.h Mon Aug 11 14:23:01 2014
@@ -123,6 +123,15 @@ class Broker : public sys::Runnable, pub
const Connection* context);
Manageable::status_t queueRedirect(const std::string& srcQueue, const std::string& tgtQueue, const Connection* context);
void queueRedirectDestroy(boost::shared_ptr<Queue> srcQ, boost::shared_ptr<Queue> tgtQ, bool moveMsgs);
+
+ // This must be the first member of Broker. It logs a start-up message
+ // at the start of Broker construction and a shut-down message at the
+ // end of destruction.
+ struct LogPrefix : public std::string {
+ LogPrefix();
+ ~LogPrefix();
+ } logPrefix;
+
boost::shared_ptr<sys::Poller> poller;
std::auto_ptr<sys::Timer> timer;
const BrokerOptions& config;
@@ -160,7 +169,6 @@ class Broker : public sys::Runnable, pub
mutable sys::Mutex linkClientPropertiesLock;
framing::FieldTable linkClientProperties;
bool timestampRcvMsgs;
- std::string logPrefix;
public:
QPID_BROKER_EXTERN virtual ~Broker();
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp?rev=1617293&r1=1617292&r2=1617293&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Daemon.cpp Mon Aug 11 14:23:01 2014
@@ -91,8 +91,7 @@ void Daemon::fork()
child();
}
catch (const exception& e) {
- QPID_LOG(critical, "Unexpected error: " << e.what());
- uint16_t port = 0;
+ uint16_t port = 0;
if (write(pipeFds[1], &port, sizeof(uint16_t))) {};
std::string pipeFailureMessage = e.what();
@@ -115,7 +114,7 @@ Daemon::~Daemon() {
uint16_t Daemon::wait(int timeout) { // parent waits for child.
try {
- errno = 0;
+ errno = 0;
struct timeval tv;
tv.tv_sec = timeout;
tv.tv_usec = 0;
Modified: qpid/trunk/qpid/cpp/src/qpid/linearstore/JournalImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/linearstore/JournalImpl.cpp?rev=1617293&r1=1617292&r2=1617293&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/linearstore/JournalImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/linearstore/JournalImpl.cpp Mon Aug 11 14:23:01 2014
@@ -78,7 +78,7 @@ JournalImpl::JournalImpl(::qpid::sys::Ti
initManagement(a);
- QLS_LOG2(notice, _jid, "Created");
+ QLS_LOG2(info, _jid, "Created");
std::ostringstream oss;
oss << "Journal directory = \"" << journalDirectory << "\"";
QLS_LOG2(debug, _jid, oss.str());
@@ -99,7 +99,7 @@ JournalImpl::~JournalImpl()
_mgmtObject.reset();
}
- QLS_LOG2(notice, _jid, "Destroyed");
+ QLS_LOG2(info, _jid, "Destroyed");
}
void
@@ -136,7 +136,7 @@ JournalImpl::initialize(::qpid::linearst
::qpid::linearstore::journal::aio_callback* const cbp)
{
// efpp->createJournal(_jdir);
-// QLS_LOG2(notice, _jid, "Initialized");
+// QLS_LOG2(info, _jid, "Initialized");
// std::ostringstream oss;
//// oss << "Initialize; num_jfiles=" << num_jfiles << " jfsize_sblks=" << jfsize_sblks;
// oss << "Initialize; efpPartitionNumber=" << efpp_->getPartitionNumber();
Modified: qpid/trunk/qpid/cpp/src/qpid/linearstore/MessageStoreImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/linearstore/MessageStoreImpl.cpp?rev=1617293&r1=1617292&r2=1617293&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/linearstore/MessageStoreImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/linearstore/MessageStoreImpl.cpp Mon Aug 11 14:23:01 2014
@@ -201,7 +201,7 @@ bool MessageStoreImpl::init(const std::s
else
init();
- QLS_LOG(notice, "Store module initialized; store-dir=" << storeDir_);
+ QLS_LOG(info, "Store module initialized; store-dir=" << storeDir_);
QLS_LOG(info, "> Default EFP partition: " << defaultEfpPartitionNumber);
QLS_LOG(info, "> Default EFP file size: " << defaultEfpFileSize_kib << " (KiB)");
QLS_LOG(info, "> Default write cache page size: " << wCachePageSizeKib_ << " (KiB)");
@@ -337,7 +337,7 @@ void MessageStoreImpl::truncateInit()
qpid::linearstore::journal::jdir::delete_dir(getBdbBaseDir());
qpid::linearstore::journal::jdir::delete_dir(getJrnlBaseDir());
qpid::linearstore::journal::jdir::delete_dir(getTplBaseDir());
- QLS_LOG(notice, "Store directory " << getStoreTopLevelDir() << " was truncated.");
+ QLS_LOG(info, "Store directory " << getStoreTopLevelDir() << " was truncated.");
init();
}
Modified: qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.cpp?rev=1617293&r1=1617292&r2=1617293&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.cpp Mon Aug 11 14:23:01 2014
@@ -91,7 +91,7 @@ void EmptyFilePoolManager::findEfpPartit
}
}
- journalLogRef_.log(JournalLog::LOG_NOTICE, "EFP Manager initialization complete");
+ journalLogRef_.log(JournalLog::LOG_INFO, "EFP Manager initialization complete");
std::vector<qpid::linearstore::journal::EmptyFilePoolPartition*> partitionList;
std::vector<qpid::linearstore::journal::EmptyFilePool*> filePoolList;
getEfpPartitions(partitionList);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org