slightly more consistant stats process log names
Also a quick fix to the auditor tests xattr mock
This commit is contained in:
parent
1c939ad8c9
commit
8193e517af
@ -23,4 +23,4 @@ if __name__ == '__main__':
|
||||
# currently AccountStat only supports run_once
|
||||
options['once'] = True
|
||||
run_daemon(AccountStat, conf_file, section_name='log-processor-stats',
|
||||
**options)
|
||||
log_name="account-stats", **options)
|
||||
|
@ -34,7 +34,7 @@ if __name__ == '__main__':
|
||||
uploader_conf.update(plugin_conf)
|
||||
|
||||
# pre-configure logger
|
||||
logger = utils.get_logger(uploader_conf, plugin, log_route='log-uploader',
|
||||
logger = utils.get_logger(uploader_conf, log_route='log-uploader',
|
||||
log_to_console=options.get('verbose', False))
|
||||
# currently LogUploader only supports run_once
|
||||
options['once'] = True
|
||||
|
@ -26,11 +26,7 @@ class CatchErrorMiddleware(object):
|
||||
|
||||
def __init__(self, app, conf):
|
||||
self.app = app
|
||||
# if the application already has a logger we should use that one
|
||||
self.logger = getattr(app, 'logger', None)
|
||||
if not self.logger:
|
||||
# and only call get_logger if we have to
|
||||
self.logger = get_logger(conf, log_route='catch-errors')
|
||||
self.logger = get_logger(conf, log_route='catch-errors')
|
||||
|
||||
def __call__(self, env, start_response):
|
||||
try:
|
||||
|
@ -64,9 +64,9 @@ class LogUploader(Daemon):
|
||||
self.container_name = container_name
|
||||
self.filename_format = source_filename_format
|
||||
self.internal_proxy = InternalProxy(proxy_server_conf)
|
||||
log_name = 'swift-log-uploader-%s' % plugin_name
|
||||
self.logger = \
|
||||
utils.get_logger(uploader_conf, plugin_name, log_route=plugin_name)
|
||||
log_name = '%s-log-uploader' % plugin_name
|
||||
self.logger = utils.get_logger(uploader_conf, log_name,
|
||||
log_route=plugin_name)
|
||||
|
||||
def run_once(self):
|
||||
self.logger.info(_("Uploading logs"))
|
||||
|
@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
# TODO: Tests
|
||||
from test import unit as _setup_mocks
|
||||
from test import unit
|
||||
import unittest
|
||||
import tempfile
|
||||
import os
|
||||
@ -57,6 +57,7 @@ class TestAuditor(unittest.TestCase):
|
||||
|
||||
def tearDown(self):
|
||||
rmtree(os.path.dirname(self.testdir), ignore_errors=1)
|
||||
unit.xattr_data = {}
|
||||
|
||||
def test_object_audit_extra_data(self):
|
||||
self.auditor = auditor.ObjectAuditor(self.conf)
|
||||
|
Loading…
x
Reference in New Issue
Block a user