syslog changes
This commit is contained in:
		| @@ -215,11 +215,14 @@ def serve(filename): | |||||||
|         FLAGS.pidfile = '%s.pid' % name |         FLAGS.pidfile = '%s.pid' % name | ||||||
|     elif FLAGS.pidfile.endswith('twistd.pid'): |     elif FLAGS.pidfile.endswith('twistd.pid'): | ||||||
|         FLAGS.pidfile = FLAGS.pidfile.replace('twistd.pid', '%s.pid' % name) |         FLAGS.pidfile = FLAGS.pidfile.replace('twistd.pid', '%s.pid' % name) | ||||||
|  |  | ||||||
|     if not FLAGS.logfile: |     if not FLAGS.logfile: | ||||||
|         FLAGS.logfile = '%s.log' % name |         FLAGS.logfile = '%s.log' % name | ||||||
|     elif FLAGS.logfile.endswith('twistd.log'): |     elif FLAGS.logfile.endswith('twistd.log'): | ||||||
|         FLAGS.logfile = FLAGS.logfile.replace('twistd.log', '%s.log' % name) |         FLAGS.logfile = FLAGS.logfile.replace('twistd.log', '%s.log' % name) | ||||||
|  |     if not FLAGS.prefix: | ||||||
|  |         FLAGS.prefix = name | ||||||
|  |     elif FLAGS.prefix.endswith('twisted'): | ||||||
|  |         FLAGS.prefix = FLAGS.prefix.replace('twisted', name) | ||||||
|  |  | ||||||
|     action = 'start' |     action = 'start' | ||||||
|     if len(argv) > 1: |     if len(argv) > 1: | ||||||
| @@ -237,7 +240,7 @@ def serve(filename): | |||||||
|         sys.exit(1) |         sys.exit(1) | ||||||
|  |  | ||||||
|     formatter = logging.Formatter( |     formatter = logging.Formatter( | ||||||
|         name + '(%(name)s): %(levelname)s %(message)s') |         '(%(name)s): %(levelname)s %(message)r') | ||||||
|     handler = logging.StreamHandler(log.StdioOnnaStick()) |     handler = logging.StreamHandler(log.StdioOnnaStick()) | ||||||
|     handler.setFormatter(formatter) |     handler.setFormatter(formatter) | ||||||
|     logging.getLogger().addHandler(handler) |     logging.getLogger().addHandler(handler) | ||||||
| @@ -247,11 +250,6 @@ def serve(filename): | |||||||
|     else: |     else: | ||||||
|         logging.getLogger().setLevel(logging.WARNING) |         logging.getLogger().setLevel(logging.WARNING) | ||||||
|  |  | ||||||
|     if FLAGS.syslog: |  | ||||||
|         syslog = logging.handlers.SysLogHandler(address='/dev/log') |  | ||||||
|         syslog.setFormatter(formatter) |  | ||||||
|         logging.getLogger().addHandler(syslog) |  | ||||||
|  |  | ||||||
|     logging.debug("Full set of FLAGS:") |     logging.debug("Full set of FLAGS:") | ||||||
|     for flag in FLAGS: |     for flag in FLAGS: | ||||||
|         logging.debug("%s : %s" % (flag, FLAGS.get(flag, None))) |         logging.debug("%s : %s" % (flag, FLAGS.get(flag, None))) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Vishvananda Ishaya
					Vishvananda Ishaya