[medusa] Changing logger.file_logger output (original) (raw)

rushing@n... rushing@n...
Fri, 2 Apr 1999 10:42:09 -0800 (PST)


ray@u... writes:

How would I trim down the ipaddress in the log to eliminate the numbers after the ':'? Currently the first column in each row has the ipaddress formatted like this: 206.58.165.2:1206 and we would like it to be entered like this: 206.58.165.2

The curent format of the log files is causing our log analysis software to choke on the ipaddress calculations.

This should do the trick:

def log (self, bytes): self.channel.server.logger.log ( self.channel.addr[0], '%d - - [%s] "%s" %d %d\n' % ( self.channel.addr[1], self.log_date_string (time.time()), self.request, self.reply_code, bytes ) )

==>

def log (self, bytes): self.channel.server.logger.log ( self.channel.addr[0], ' - - [%s] "%s" %d %d\n' % ( self.log_date_string (time.time()), self.request, self.reply_code, bytes ) )

-Sam


eGroup home: http://www.eGroups.com/list/medusa Free Web-based e-mail groups by eGroups.com