Skip to content

Commit

Permalink
Better way of handling #111
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco committed Apr 4, 2015
1 parent 85ee93f commit ffa273e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli/utils/start.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ end
local function prepare_nginx_working_dir(kong_config)
if kong_config.send_anonymous_reports then
-- If there is no internet connection, disable this feature
if os.execute("dig +time=2 +tries=2 "..KONG_SYSLOG.. "> /dev/null") == 0 then
local socket = require "socket"
if socket.dns.toip(KONG_SYSLOG) then
kong_config.nginx = "error_log syslog:server="..KONG_SYSLOG..":61828 error;\n"..kong_config.nginx
else
cutils.logger:warn("The internet connection might not be available, cannot resolve "..KONG_SYSLOG)
Expand Down

0 comments on commit ffa273e

Please sign in to comment.