diff --git a/configs/development.ini b/configs/development.ini --- a/configs/development.ini +++ b/configs/development.ini @@ -440,6 +440,8 @@ rc_cache.cache_perms.expiration_time = 3 ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends #rc_cache.cache_perms.arguments.distributed_lock = true +; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen +#rc_cache.cache_perms.arguments.lock_auto_renewal = true ; *************************************************** ; `cache_repo` cache for file tree, Readme, RSS FEEDS @@ -463,6 +465,8 @@ rc_cache.cache_repo.expiration_time = 25 ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends #rc_cache.cache_repo.arguments.distributed_lock = true +; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen +#rc_cache.cache_repo.arguments.lock_auto_renewal = true ; ############## ; BEAKER SESSION @@ -760,6 +764,7 @@ appenlight.log_namespace_blacklist = #statsd.statsd_prefix = #statsd.statsd_ipv6 = false + ; Dummy marker to add new entries after. ; Add any custom entries below. Please don't remove this marker. custom.conf = 1 @@ -823,6 +828,9 @@ class = StreamHandler args = (sys.stderr, ) level = DEBUG formatter = color_formatter +; To enable JSON formatted logs replace generic with json +; This allows sending properly formatted logs to grafana loki or elasticsearch +#formatter = json [handler_console_sql] ; "level = DEBUG" logs SQL queries and results. @@ -851,3 +859,7 @@ datefmt = %Y-%m-%d %H:%M:%S class = rhodecode.lib.logging_formatter.ColorFormatterSql format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s datefmt = %Y-%m-%d %H:%M:%S + +[formatter_json] +format = %(message)s +class = rhodecode.lib._vendor.jsonlogger.JsonFormatter \ No newline at end of file diff --git a/configs/gunicorn_config.py b/configs/gunicorn_config.py --- a/configs/gunicorn_config.py +++ b/configs/gunicorn_config.py @@ -33,6 +33,10 @@ tmp_upload_dir = None access_log_format = ( '%(t)s %(p)s INFO [GNCRN] %(h)-15s rqt:%(L)s %(s)s %(b)-6s "%(m)s:%(U)s %(q)s" usr:%(u)s "%(f)s" "%(a)s"') +# loki format for easier parsing in grafana +#access_log_format = ( +# 'time="%(t)s" pid=%(p)s level="INFO" type="[GNCRN]" ip="%(h)-15s" rqt="%(L)s" response_code="%(s)s" response_bytes="%(b)-6s" uri="%(m)s:%(U)s %(q)s" user=":%(u)s" user_agent="%(a)s"') + # self adjust workers based on CPU count # workers = get_workers() diff --git a/configs/production.ini b/configs/production.ini --- a/configs/production.ini +++ b/configs/production.ini @@ -715,6 +715,7 @@ appenlight.log_namespace_blacklist = #statsd.statsd_prefix = #statsd.statsd_ipv6 = false + ; Dummy marker to add new entries after. ; Add any custom entries below. Please don't remove this marker. custom.conf = 1 @@ -778,6 +779,9 @@ class = StreamHandler args = (sys.stderr, ) level = INFO formatter = generic +; To enable JSON formatted logs replace generic with json +; This allows sending properly formatted logs to grafana loki or elasticsearch +#formatter = json [handler_console_sql] ; "level = DEBUG" logs SQL queries and results. @@ -806,3 +810,7 @@ datefmt = %Y-%m-%d %H:%M:%S class = rhodecode.lib.logging_formatter.ColorFormatterSql format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s datefmt = %Y-%m-%d %H:%M:%S + +[formatter_json] +format = %(message)s +class = rhodecode.lib._vendor.jsonlogger.JsonFormatter \ No newline at end of file