mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
feature #4097: Message format conform 4.x series
This commit is contained in:
parent
b16fea2532
commit
8c8bb43d82
@ -112,7 +112,7 @@ StdLog::StdLog(const MessageType level, int oid,
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
oss << "[" << PoolObjectSQL::type_to_str(obj_type) << " " << oid << "] ";
|
||||
oss << "[" << PoolObjectSQL::type_to_str(obj_type) << " " << oid << "]";
|
||||
resource_label = oss.str();
|
||||
}
|
||||
|
||||
@ -140,10 +140,11 @@ void StdLog::log(
|
||||
str[24] = '\0';
|
||||
|
||||
std::clog << str << " "
|
||||
<< resource_label
|
||||
<< "[Z"<< zone_id<< "]"
|
||||
<< "[" << module << "]"
|
||||
<< "[" << error_names[type] << "]: "
|
||||
<< resource_label << message << endl;
|
||||
<< message << endl;
|
||||
|
||||
std::clog.flush();
|
||||
}
|
||||
@ -172,7 +173,7 @@ SysLog::SysLog(const MessageType level, int oid,
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
oss << "[" << PoolObjectSQL::type_to_str(obj_type) << " " << oid << "] ";
|
||||
oss << "[" << PoolObjectSQL::type_to_str(obj_type) << " " << oid << "]";
|
||||
resource_label = oss.str();
|
||||
}
|
||||
|
||||
@ -194,10 +195,11 @@ void SysLog::log(
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
oss << "[Z"<< zone_id<< "]"
|
||||
oss << resource_label
|
||||
<< "[Z"<< zone_id<< "]"
|
||||
<< "[" << module << "]"
|
||||
<< "[" << error_names[type] << "]: "
|
||||
<< resource_label << line;
|
||||
<< line;
|
||||
|
||||
syslog(slevel, oss.str().c_str());
|
||||
}
|
||||
|
@ -377,25 +377,25 @@ void Nebula::start(bool bootstrap_only)
|
||||
// -----------------------------------------------------------
|
||||
// Close stds, we no longer need them
|
||||
// -----------------------------------------------------------
|
||||
|
||||
fd = open("/dev/null", O_RDWR);
|
||||
|
||||
dup2(fd,0);
|
||||
|
||||
if (NebulaLog::log_type() != NebulaLog::STD )
|
||||
{
|
||||
fd = open("/dev/null", O_RDWR);
|
||||
|
||||
dup2(fd,0);
|
||||
dup2(fd,1);
|
||||
dup2(fd,2);
|
||||
|
||||
close(fd);
|
||||
|
||||
fcntl(0, F_SETFD, 0); // Keep them open across exec funcs
|
||||
fcntl(1, F_SETFD, 0);
|
||||
fcntl(2, F_SETFD, 0);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
fcntl(0,F_SETFD,0); // Keep them open across exec funcs
|
||||
|
||||
if (NebulaLog::log_type() != NebulaLog::STD )
|
||||
else
|
||||
{
|
||||
fcntl(1,F_SETFD,0);
|
||||
fcntl(2,F_SETFD,0);
|
||||
fcntl(0, F_SETFD, FD_CLOEXEC);
|
||||
fcntl(1, F_SETFD, FD_CLOEXEC);
|
||||
fcntl(2, F_SETFD, FD_CLOEXEC);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user