flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

Expose configuration option to use custom gunicorn logger class

Open rolodato opened this issue 6 months ago • 1 comments

Is your feature request related to a problem?

Gunicorn's default loggers have some limitations such as not being able to use ISO timestamps: https://github.com/benoitc/gunicorn/issues/1771. The only way to work around these limitations is to implement a custom logger class, but Flagsmith does not provide an option to use one.

Describe the solution you'd like.

Add an environment variable such as GUNICORN_LOGGER_CLASS that accepts a class reference such as my.path.to.GunicornLogger, which customers can use to implement any logging they choose.

Customers would need to mount their custom class into the Flagsmith container, for example through a k8s ConfigMap or Docker volume mount.

Describe alternatives you've considered

We could add ad-hoc options to provide specific logger configurations such as ISO timestamps, but this won't scale to arbitrary customer requirements.

Additional context

No response

rolodato avatar Jun 09 '25 12:06 rolodato

As an immediate remedy for the specific customer ask, LOG_FORMAT=json will produce timestamps in ISO format.

As to the broader issue, IMO, full support for GUNICORN_ env vars, including GUNICORN_CMD_ARGS, should be implemented. Since this concerns the flagsmith entrypoint this should be a flagsmith-common issue as well.

khvn26 avatar Jun 09 '25 13:06 khvn26

Closing this as not planned / stale.

matthewelwell avatar Nov 20 '25 11:11 matthewelwell