tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lavigne <dlavi...@mindspring.com>
Subject Date/Time in the log <code>
Date Fri, 16 Jun 2000 00:18:11 GMT
I might be the only one interested in having the date and time in the log 
when logging, if so ignore this email.  Otherwise here is my first 
contribution.


static int JK_METHOD log_to_file(jk_logger_t 
*l,
                                  int level,
                                  const char *what)
{
     if(l && l->level <= level && l->logger_private && what)
	{
		int sz;
		char tmpTime[128];
		char tmpDate[128];
		char buffer[4096];//4k buffer to store log line in, could be too small 
SOMETIMES?....!!!!		
		_strtime(tmpTime);
		_strdate(tmpDate);

		sprintf(buffer,"%s %s - %s", tmpDate, tmpTime, what);
		
         sz = strlen(buffer); //was strlen(what);
         if(sz)
		{
             file_logger_t *p = l->logger_private;
             // was this before date time added fwrite(what, 1, sz, 
p->logfile);
			fwrite(buffer, 1, sz, p->logfile);
		}

		return JK_TRUE;
     }

     return JK_FALSE;
}

David Lavigne <dlavigne@siberianhuskies.org>
   and the pack at Bentley Mannor, Atlanta GA
      Wolfin (Siberian Husky / Samoyed) 6yr "That's my couch"
      Isabella (Siberian Husky) 2yr "Well, then I get the bed"

Our Home: http://www.SiberianHuskies.ORG


Mime
View raw message