• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Elastic Search Logging Using NGINX Upstream

Anthony Parsons

Well-known member
#1
Does anyone know how to get elasticsearch.log to log everything when using NGINX proxying ES as an upstream server?

Setting /etc/elasticsearch/log4j2.properties to 'error = debug' doesn't even work, as all the ES data is being proxied via NGINX... so the NGINX logs just tell the packets received / sent, they don't contain ES info.

I have an issue in my post data that causes ES rebuilding posts to fail, but without ES logs telling me exactly why it failed...

Anyone have experience with this scenario?
 

Anthony Parsons

Well-known member
#2
Maybe to more specific, is how to get Elasticsearch data into the log stream?

I have the basic for time and action:

log_format upstreamlog '[$time_local] $remote_addr - $remote_user - $server_name to: $upstream_addr: $request upstream_response_time $upstream_response_time msec $msec request_time $request_time';

Logging to:

access_log /var/log/nginx/access.log upstreamlog;