Skip to content

Commit

Permalink
feat(config) granular admin and error logs configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
p0pr0ck5 authored and thibaultcha committed May 25, 2017
1 parent 09bed00 commit 23585aa
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
24 changes: 24 additions & 0 deletions kong.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,30 @@
# Note: See http://nginx.org/en/docs/ngx_core_module.html#error_log for a list
# of accepted values.

#proxy_access_log = logs/access.log # Path for proxy port request access
# logs. Set this value to `off` to
# disable logging proxy requests.
# If this value is a relative path, it
# will be placed under the `prefix`
# location.

#proxy_error_log = logs/error.log # Path for proxy port request error
# logs. Granularity of these logs is
# adjusted by the `log_level`
# directive.

#admin_access_log = logs/admin_access.log # Path for Admin API request access
# logs. Set this value to `off` to
# disable logging Admin API requests.
# If this value is a relative path, it
# will be placed under the `prefix`
# location.

#admin_error_log = logs/error.log # Path for Admin API request error
# logs. Granularity of these logs is
# adjusted by the `log_level`
# directive.

#custom_plugins = # Comma-separated list of additional plugins
# this node should load.
# Use this property to load custom plugins
Expand Down
4 changes: 4 additions & 0 deletions kong/conf_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ local CONF_INFERENCES = {
ssl = {typ = "boolean"},
admin_ssl = {typ = "boolean"},

proxy_access_log = {typ = "string"},
proxy_error_log = {typ = "string"},
admin_access_log = {typ = "string"},
admin_error_log = {typ = "string"},
log_level = {enum = {"debug", "info", "notice", "warn",
"error", "crit", "alert", "emerg"}},
custom_plugins = {typ = "array"},
Expand Down
4 changes: 4 additions & 0 deletions kong/templates/kong_defaults.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
return [[
prefix = /usr/local/kong/
log_level = notice
proxy_access_log = logs/access.log
proxy_error_log = logs/error.log
admin_access_log = logs/admin_access.log
admin_error_log = logs/error.log
custom_plugins = NONE
anonymous_reports = on
Expand Down
9 changes: 5 additions & 4 deletions kong/templates/nginx_kong.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
return [[
charset UTF-8;
error_log logs/error.log ${{LOG_LEVEL}};
> if anonymous_reports then
${{SYSLOG_REPORTS}}
> end
Expand Down Expand Up @@ -81,7 +79,9 @@ server {
error_page 404 408 411 412 413 414 417 /kong_error_handler;
error_page 500 502 503 504 /kong_error_handler;
access_log logs/access.log;
access_log ${{PROXY_ACCESS_LOG}};
error_log ${{PROXY_ERROR_LOG}} ${{LOG_LEVEL}};
> if ssl then
listen ${{PROXY_LISTEN_SSL}} ssl;
Expand Down Expand Up @@ -143,7 +143,8 @@ server {
server_name kong_admin;
listen ${{ADMIN_LISTEN}};
access_log logs/admin_access.log;
access_log ${{ADMIN_ACCESS_LOG}};
error_log ${{ADMIN_ERROR_LOG}} ${{LOG_LEVEL}};
client_max_body_size 10m;
client_body_buffer_size 10m;
Expand Down

0 comments on commit 23585aa

Please sign in to comment.