Skip to content

Commit 57a7dcd

Browse files
authored
feat: support configuring the buffer size of the access log (#10225)
1 parent 9b2031a commit 57a7dcd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

apisix/cli/ngx_tpl.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,12 @@ http {
365365
log_format main escape={* http.access_log_format_escape *} '{* http.access_log_format *}';
366366
uninitialized_variable_warn off;
367367
368+
{% if http.access_log_buffer then %}
369+
access_log {* http.access_log *} main buffer={* http.access_log_buffer *} flush=3;
370+
{% else %}
368371
access_log {* http.access_log *} main buffer=16384 flush=3;
369372
{% end %}
373+
{% end %}
370374
open_file_cache max=1000 inactive=60;
371375
client_max_body_size {* http.client_max_body_size *};
372376
keepalive_timeout {* http.keepalive_timeout *};

conf/config-default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ nginx_config: # Config for render the template to generate n
213213
http:
214214
enable_access_log: true # Enable HTTP proxy access logging.
215215
access_log: logs/access.log # Location of the access log.
216+
access_log_buffer: 16384 # buffer size of access log.
216217
access_log_format: "$remote_addr - $remote_user [$time_local] $http_host \"$request\" $status $body_bytes_sent $request_time \"$http_referer\" \"$http_user_agent\" $upstream_addr $upstream_status $upstream_response_time \"$upstream_scheme://$upstream_host$upstream_uri\""
217218
# Customize log format: http://nginx.org/en/docs/varindex.html
218219
access_log_format_escape: default # Escape default or json characters in variables.

0 commit comments

Comments
 (0)