#include <cynara-client.h>
#include <cynara-session.h>
-#include <klay/audit/logger.h>
#include <klay/audit/dlog-sink.h>
+#include "logger.h"
#include "rmi/secure-erase.h"
#include "rmi/internal-encryption.h"
#include "rmi/external-encryption.h"
std::unique_ptr<ode::InternalEncryption> internalEncryption;
std::unique_ptr<ode::ExternalEncryption> externalEncryption;
std::unique_ptr<ode::ExtensionEncryption> extensionEncryption;
+std::unique_ptr<audit::DlogLogSink> _sink = nullptr;
} // namespace
+audit::LogSink *SINK = nullptr;
+
Server::Server()
{
- audit::Logger::setBackend(new audit::DlogLogSink());
- audit::Logger::setTag("ODE");
+ _sink.reset(new audit::DlogLogSink("ODE"));
+ SINK = dynamic_cast<audit::LogSink*>((_sink).get());
- INFO("ODE server starting.");
+ INFO(SINK, "ODE server starting.");
service.reset(new rmi::Service(ODE_MANAGER_ADDRESS));
}
if (::cynara_initialize(&p_cynara, NULL) != CYNARA_API_SUCCESS) {
- ERROR("Failure in cynara API");
+ ERROR(SINK, "Failure in cynara API");
return false;
}
std::to_string(cred.uid).c_str(),
privilege.c_str()) != CYNARA_API_ACCESS_ALLOWED) {
::cynara_finish(p_cynara);
- ERROR("Access denied: " + cred.security + " : " + privilege);
+ ERROR(SINK, "Access denied: " + cred.security + " : " + privilege);
return false;
}
runtime::FileDescriptor Server::registerNotificationSubscriber(const std::string& name)
{
- INFO("registerNotificationSubscriber");
- INFO(name);
+ INFO(SINK, "registerNotificationSubscriber");
+ INFO(SINK, name);
return runtime::FileDescriptor(service->subscribeNotification(name), true);
}