Skip to content

Instantly share code, notes, and snippets.

@richm
Created April 24, 2018 17:01
Show Gist options
  • Save richm/cda9082c8f44b17df1283407f4e9245a to your computer and use it in GitHub Desktop.
Save richm/cda9082c8f44b17df1283407f4e9245a to your computer and use it in GitHub Desktop.
python -c '
import sys,yaml
with open("logging.yml") as file:
c = yaml.load(file)
for appender in ["file", "deprecation_log_file", "index_search_slow_log_file", "index_indexing_slow_log_file"]:
if f = c["appender"][appender]:
f = c["type"] = "io.openshift.log4jextras.appender.DailyRollingFileAppender"
f["maxBackupIndex"] = sys.argv[1]
f["datePattern"] = sys.argv[2]
f["append"] = True
with open("logging.new","w") as target:
yaml.dump(c, target)
' ${ES_LOGS_MAX_BACKUP} ${ES_LOGS_DATE_PATTERN}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment