[Pdns-users] Re: PowerDNS 2.9.14 has been released!

Christof Meerwald cmeerw at web.de
Sat Jan 17 13:10:41 UTC 2004


On Fri, 16 Jan 2004 23:05:04 +0100, bert hubert wrote:
> Big release with the fix for the all important 2^30 seconds problem and a
> lot of other news.

Here is another problem:

pdns doesn't write anything to syslog if it is daemonized, see
pdns/logger.cc:

void Logger::log(const string &msg, Urgency u)
{
  struct tm tm;
  time_t t;
  time(&t);
  tm=*localtime(&t);

  if(u<=consoleUrgency) {// Sep 14 06:52:09
    char buffer[50];
    strftime(buffer,sizeof(buffer),"%b %d %H:%M:%S ", &tm);
    clog<<buffer;
    clog <<msg <<endl;

   if( u <= d_loglevel )
   {
     extern StatBag S;
     S.ringAccount("logmessages",msg);
     syslog(u,"%s",msg.c_str());
   }
  }
}

I guess the code should instead be:

void Logger::log(const string &msg, Urgency u)
{
  struct tm tm;
  time_t t;
  time(&t);
  tm=*localtime(&t);

  if(u<=consoleUrgency) {// Sep 14 06:52:09
    char buffer[50];
    strftime(buffer,sizeof(buffer),"%b %d %H:%M:%S ", &tm);
    clog<<buffer;
    clog <<msg <<endl;
  } // this one is missing in the original code

  if( u <= d_loglevel )
  {
    extern StatBag S;
    S.ringAccount("logmessages",msg);
    syslog(u,"%s",msg.c_str());
  }
}


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw at jabber.at
mailto cmeerw at web.de


More information about the Pdns-users mailing list