summaryrefslogtreecommitdiffstats
path: root/src/Core/RequestHandlers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/RequestHandlers')
-rw-r--r--src/Core/RequestHandlers/LogRequestHandler.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Core/RequestHandlers/LogRequestHandler.cpp b/src/Core/RequestHandlers/LogRequestHandler.cpp
index 5640159..6bda627 100644
--- a/src/Core/RequestHandlers/LogRequestHandler.cpp
+++ b/src/Core/RequestHandlers/LogRequestHandler.cpp
@@ -20,6 +20,7 @@
#include "LogRequestHandler.h"
#include <Common/Logger.h>
#include <Common/RemoteLogger.h>
+#include "../ConnectionManager.h"
#include <Net/Connection.h>
#include <Net/Packets/ErrorPacket.h>
#include <Net/Packets/LogPacket.h>
@@ -40,7 +41,14 @@ void LogRequestHandler::handlePacket(Net::Connection *connection, const Net::Pac
// TODO Require authentication
Net::Packets::LogPacket logPacket(packet);
- Common::RemoteLogger::log(logPacket.getCategory(), logPacket.getLevel(), logPacket.getTimestamp(), logPacket.getMessage().c_str(), std::string());
+
+ try {
+ Common::RemoteLogger::log(logPacket.getCategory(), logPacket.getLevel(), logPacket.getTimestamp(), logPacket.getMessage().c_str(),
+ ConnectionManager::getConnectionManager()->getDaemonName(connection));
+ }
+ catch(Common::Exception &e) {
+ Common::Logger::logf(Common::Logger::ERROR, "Can't determine daemon name: %s", e.strerror().c_str());
+ }
connection->send(Net::Packet(Net::Packet::OK, packet.getRequestId()));