Example #1
0
 def log_access(self, status_code, response_size=None, username=None):
     if self.access_log is None:
         return
     if not self.opts.log_not_found and status_code == httplib.NOT_FOUND:
         return
     line = '%s port-%s %s %s "%s" %s %s' % (
         self.remote_addr, self.remote_port, username
         or '-', fast_now_strftime('%d/%b/%Y:%H:%M:%S %z'),
         force_unicode(self.request_line or '', 'utf-8'), status_code,
         ('-' if response_size is None else response_size))
     self.access_log(line)
Example #2
0
 def log_access(self, status_code, response_size=None, username=None):
     if self.access_log is None:
         return
     if not self.opts.log_not_found and status_code == httplib.NOT_FOUND:
         return
     ff = self.forwarded_for
     if ff:
         ff = '[%s] ' % ff
     line = '%s port-%s %s%s %s "%s" %s %s' % (
         self.remote_addr, self.remote_port, ff or '', username or '-',
         fast_now_strftime('%d/%b/%Y:%H:%M:%S %z'),
         force_unicode(self.request_line or '', 'utf-8'),
         status_code, ('-' if response_size is None else response_size))
     self.access_log(line)
Example #3
0
 def log_access(self, status_code, response_size=None, username=None):
     if self.access_log is None:
         return
     if not self.opts.log_not_found and status_code == http_client.NOT_FOUND:
         return
     ff = self.forwarded_for
     if ff:
         ff = '[%s] ' % ff
     line = '{} port-{} {}{} {} "{}" {} {}'.format(
         self.remote_addr, self.remote_port, ff or '', username or '-',
         fast_now_strftime('%d/%b/%Y:%H:%M:%S %z'),
         force_unicode(self.request_line or '', 'utf-8'), status_code,
         ('-' if response_size is None else response_size))
     self.access_log(line)