Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core) configurable admin and error logs #2552

Merged
merged 1 commit into from
May 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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