[feature request] kubeapi-load-balancer's nginx can configure json formatted logs via charm

Bug #1962424 reported by Chuan Li
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Kubernetes API Load Balancer
New
Undecided
Unassigned

Bug Description

One of UA customer request a feature that kubeapi-load-balancer charm can configure nginx access_log as json format.

The customer make a general propose as below:
name: nginx_log_format
description: Adds a 'log_format' with the contents of the config value. The log_format will be named 'json_config' and applied to the loadbalancer site's 'server' stanza.
example value: '{'\n '"time_local":"$time_local",'\n '"remote_addr":"$remote_addr",'\n '"remote_user":"$remote_user",'\n '"request":"$request",'\n '"status": "$status",'\n '"body_bytes_sent":"$body_bytes_sent",'\n '"request_time":"$request_time",'\n '"http_referrer":"$http_referer",'\n '"http_user_agent":"$http_user_agent"'\n '}';

example changes this would implement in nginx:
in /etc/nginx/nginx.conf:
+ log_format json_combined escape=json ${value}

in /etc/nginx/sites-available/apilb:
- access_log /var/log/nginx.access.log;
+ access_log /var/log/nginx.access.log json_combined;

Tags: sts
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.