diff --git a/rhodecode/lib/utils2.py b/rhodecode/lib/utils2.py --- a/rhodecode/lib/utils2.py +++ b/rhodecode/lib/utils2.py @@ -497,3 +497,11 @@ def fix_PATH(os_=None): cur_path = os.path.split(sys.executable)[0] if not os.environ['PATH'].startswith(cur_path): os.environ['PATH'] = '%s:%s' % (cur_path, os.environ['PATH']) + + +def obfuscate_url_pw(engine): + from sqlalchemy.engine import url + url = url.make_url(engine) + if url.password: + url.password = 'XXXXX' + return str(url) \ No newline at end of file diff --git a/rhodecode/model/__init__.py b/rhodecode/model/__init__.py --- a/rhodecode/model/__init__.py +++ b/rhodecode/model/__init__.py @@ -43,7 +43,7 @@ import logging from rhodecode.model import meta -from rhodecode.lib.utils2 import safe_str +from rhodecode.lib.utils2 import safe_str, obfuscate_url_pw log = logging.getLogger(__name__) @@ -56,7 +56,8 @@ def init_model(engine): :param engine: engine to bind to """ - log.info("initializing db for %s" % engine) + engine_str = obfuscate_url_pw(str(engine.url)) + log.info("initializing db for %s" % engine_str) meta.Base.metadata.bind = engine