diff options
author | Clay Gerrard <clay.gerrard@rackspace.com> | 2011-02-10 14:59:52 -0600 |
---|---|---|
committer | Clay Gerrard <clay.gerrard@rackspace.com> | 2011-02-10 14:59:52 -0600 |
commit | a2c9757ece0512672335c994d1ddda93a1441003 (patch) | |
tree | 9723ee5b2cf0e9f6d8afbf12228ae36189442bd8 /bin/swift-bench | |
parent | 1032c62623e7d2f8788aa1e69ec4017e14db7171 (diff) | |
download | swift-bench-a2c9757ece0512672335c994d1ddda93a1441003.tar.gz |
logging refactor to support proxy access logs
New log level "notice" set to python log level 25 maps to syslog priority
LOG_NOTICE. Used for some messages in the proxy server, but will be available
to all apps using the LogAdapter returned from get_logger. Cleaned up some
code in get_logger so that console logging works with log_routes and removed
some unneeded bits. NamedFormatter functionality was split between LogAdapter
(which now inherits from logging.LoggerAdapter) and TxnFormatter (which now is
only responsible for adding the log records txn_id).
The proxy server app now configures a separate logger for access line logging.
By default it will use the same settings as the regular proxy logger.
Diffstat (limited to 'bin/swift-bench')
-rwxr-xr-x | bin/swift-bench | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/swift-bench b/bin/swift-bench index 3c167ee..0554782 100755 --- a/bin/swift-bench +++ b/bin/swift-bench @@ -22,7 +22,7 @@ import uuid from optparse import OptionParser from swift.common.bench import BenchController -from swift.common.utils import readconf, LogAdapter, NamedFormatter +from swift.common.utils import readconf, LogAdapter # The defaults should be sufficient to run swift-bench on a SAIO CONF_DEFAULTS = { @@ -125,9 +125,9 @@ if __name__ == '__main__': options.log_level.lower(), logging.INFO)) loghandler = logging.StreamHandler() logger.addHandler(loghandler) - logger = LogAdapter(logger) - logformat = NamedFormatter('swift-bench', logger, - fmt='%(server)s %(asctime)s %(levelname)s %(message)s') + logger = LogAdapter(logger, 'swift-bench') + logformat = logging.Formatter('%(server)s %(asctime)s %(levelname)s ' + '%(message)s') loghandler.setFormatter(logformat) controller = BenchController(logger, options) |