1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-15 18:50:09 +03:00

feature #2533: xml-rpc log file can be disable through oned.conf

This commit is contained in:
Ruben S. Montero 2014-01-02 17:37:11 +01:00
parent 60c763c38b
commit bd0cb167d6
4 changed files with 50 additions and 32 deletions

View File

@ -101,13 +101,17 @@ VNC_BASE_PORT = 5900
#
# TIMEOUT: Maximum time in seconds the server will wait for the client to
# do anything while processing an RPC
#
# RPC_LOG: Create a separated log file for xml-rpc requests, in
# "/var/log/one/one_xmlrpc.log".
#*******************************************************************************
#MAX_CONN = 15
#MAX_CONN_BACKLOG = 15
#KEEPALIVE_TIMEOUT = 15
#KEEPALIVE_MAX_CONN = 30
#TIMEOUT = 15
#MAX_CONN = 15
#MAX_CONN_BACKLOG = 15
#KEEPALIVE_TIMEOUT = 15
#KEEPALIVE_MAX_CONN = 30
#TIMEOUT = 15
#RPC_LOG = NO
#*******************************************************************************
# Physical Networks configuration

View File

@ -931,12 +931,15 @@ void Nebula::start(bool bootstrap_only)
// ---- Request Manager ----
try
{
int rm_port = 0;
int max_conn;
int max_conn_backlog;
int keepalive_timeout;
int keepalive_max_conn;
int timeout;
int rm_port = 0;
int max_conn;
int max_conn_backlog;
int keepalive_timeout;
int keepalive_max_conn;
int timeout;
bool rpc_log;
string rpc_filename = "";
nebula_configuration->get("PORT", rm_port);
nebula_configuration->get("MAX_CONN", max_conn);
@ -944,10 +947,15 @@ void Nebula::start(bool bootstrap_only)
nebula_configuration->get("KEEPALIVE_TIMEOUT", keepalive_timeout);
nebula_configuration->get("KEEPALIVE_MAX_CONN", keepalive_max_conn);
nebula_configuration->get("TIMEOUT", timeout);
nebula_configuration->get("RPC_LOG", rpc_log);
if (rpc_log)
{
rpc_filename = log_location + "one_xmlrpc.log";
}
rm = new RequestManager(rm_port, max_conn, max_conn_backlog,
keepalive_timeout, keepalive_max_conn, timeout,
log_location + "one_xmlrpc.log");
keepalive_timeout, keepalive_max_conn, timeout, rpc_filename);
}
catch (bad_alloc&)
{

View File

@ -190,6 +190,7 @@ void OpenNebulaTemplate::set_conf_default()
# KEEPALIVE_TIMEOUT
# KEEPALIVE_MAX_CONN
# TIMEOUT
# RPC_LOG
#*******************************************************************************
*/
// MAX_CONN
@ -222,6 +223,11 @@ void OpenNebulaTemplate::set_conf_default()
attribute = new SingleAttribute("TIMEOUT",value);
conf_default.insert(make_pair(attribute->name(),attribute));
// RPC_LOG
value = "NO";
attribute = new SingleAttribute("RPC_LOG",value);
conf_default.insert(make_pair(attribute->name(),attribute));
/*
#*******************************************************************************
# Physical Networks configuration

View File

@ -94,25 +94,25 @@ extern "C" void * rm_xml_server_loop(void *arg)
//Start the server
#ifdef OLD_XMLRPC
rm->AbyssServer = new xmlrpc_c::serverAbyss(xmlrpc_c::serverAbyss::constrOpt()
.registryP(&rm->RequestManagerRegistry)
.logFileName(rm->xml_log_file)
.keepaliveTimeout(rm->keepalive_timeout)
.keepaliveMaxConn(rm->keepalive_max_conn)
.timeout(rm->timeout)
.socketFd(rm->socket_fd));
#else
rm->AbyssServer = new xmlrpc_c::serverAbyss(xmlrpc_c::serverAbyss::constrOpt()
.registryP(&rm->RequestManagerRegistry)
.logFileName(rm->xml_log_file)
.maxConn(rm->max_conn)
.maxConnBacklog(rm->max_conn_backlog)
.keepaliveTimeout(rm->keepalive_timeout)
.keepaliveMaxConn(rm->keepalive_max_conn)
.timeout(rm->timeout)
.socketFd(rm->socket_fd));
#endif /* OLD_XMLRPC */
xmlrpc_c::serverAbyss::constrOpt opt = xmlrpc_c::serverAbyss::constrOpt();
opt.registryP(&rm->RequestManagerRegistry);
opt.keepaliveTimeout(rm->keepalive_timeout);
opt.keepaliveMaxConn(rm->keepalive_max_conn);
opt.timeout(rm->timeout);
opt.socketFd(rm->socket_fd);
if (!rm->xml_log_file.empty())
{
opt.logFileName(rm->xml_log_file);
}
#ifndef OLD_XMLRPC
opt.maxConn(rm->max_conn);
opt.maxConnBacklog(rm->max_conn_backlog);
#endif
rm->AbyssServer = new xmlrpc_c::serverAbyss(opt);
rm->AbyssServer->run();