@@ -435,7 +435,6 @@ with open('` + configMountPath + `/` + gunicornConfigFilePath + `') as _f:
435435
436436 configSystem = configSystem + `
437437LOG_ROTATION_AGE = ` + pgAdminRetentionPeriod + ` # minutes
438- LOG_ROTATION_SIZE = 5 # MiB
439438LOG_ROTATION_MAX_LOG_FILES = ` + maxBackupRetentionNumber + `
440439
441440JSON_LOGGER = True
@@ -447,6 +446,9 @@ FILE_LOG_FORMAT_JSON = {'time': 'created', 'name': 'name', 'level': 'levelname',
447446 // Gunicorn uses the Python logging package, which sets the following attributes:
448447 // https://docs.python.org/3/library/logging.html#logrecord-attributes.
449448 // JsonFormatter is used to format the log: https://pypi.org/project/jsonformatter/
449+ // We override the gunicorn defaults (using `logconfig_dict`) to set our own file handler.
450+ // - https://docs.gunicorn.org/en/stable/settings.html#logconfig-dict
451+ // - https://github.com/benoitc/gunicorn/blob/23.0.0/gunicorn/glogging.py#L47
450452 gunicornConfig = gunicornConfig + `
451453import collections, copy, gunicorn, gunicorn.glogging
452454gunicorn.SERVER_SOFTWARE = 'Python'
@@ -481,6 +483,9 @@ logconfig_dict['formatters']['json'] = {
481483 // - https://issue.k8s.io/121294
482484 shell .MakeDirectories (0o775 , scriptMountPath , configMountPath ),
483485
486+ // Create the logs directory with g+rwx to ensure pgAdmin can write to it as well.
487+ shell .MakeDirectories (0o775 , dataMountPath , LogDirectoryAbsolutePath ),
488+
484489 // Write the system and server configurations.
485490 `echo "$1" > ` + scriptMountPath + `/config_system.py` ,
486491 `echo "$2" > ` + scriptMountPath + `/gunicorn_config.py` ,
0 commit comments