tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lavigne <>
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 

static int JK_METHOD log_to_file(jk_logger_t 
                                  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 

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

		return JK_TRUE;

     return JK_FALSE;

David Lavigne <>
   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

View raw message