diff options
author | Gilles Biannic <gilles.biannic@corp.ovh.com> | 2018-03-01 11:31:12 +0100 |
---|---|---|
committer | Romain LE DISEZ <romain.le-disez@corp.ovh.com> | 2019-05-02 17:43:25 -0600 |
commit | a4cc353375264e4bcd8f9aef2f0701ae800e0e73 (patch) | |
tree | 0718c1b26d6e6dad0aa042bbf53b9c56528ecdce /swift/common/base_storage_server.py | |
parent | 89eced960c5bf5c2e14b6245c70b615dc23d45a6 (diff) | |
download | swift-a4cc353375264e4bcd8f9aef2f0701ae800e0e73.tar.gz |
Make log format for requests configurable
Add the log_msg_template option in proxy-server.conf and log_format in
a/c/o-server.conf. It is a string parsable by Python's format()
function. Some fields containing user data might be anonymized by using
log_anonymization_method and log_anonymization_salt.
Change-Id: I29e30ef45fe3f8a026e7897127ffae08a6a80cd9
Diffstat (limited to 'swift/common/base_storage_server.py')
-rw-r--r-- | swift/common/base_storage_server.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/swift/common/base_storage_server.py b/swift/common/base_storage_server.py index f7b4be8ea..e3d1d4a88 100644 --- a/swift/common/base_storage_server.py +++ b/swift/common/base_storage_server.py @@ -15,7 +15,8 @@ import inspect from swift import __version__ as swift_version -from swift.common.utils import public, timing_stats, config_true_value +from swift.common.utils import public, timing_stats, config_true_value, \ + LOG_LINE_DEFAULT_FORMAT from swift.common.swob import Response @@ -30,6 +31,9 @@ class BaseStorageServer(object): if replication_server is not None: replication_server = config_true_value(replication_server) self.replication_server = replication_server + self.log_format = conf.get('log_format', LOG_LINE_DEFAULT_FORMAT) + self.anonymization_method = conf.get('log_anonymization_method', 'md5') + self.anonymization_salt = conf.get('log_anonymization_salt', '') @property def server_type(self): |