From 93c4ff2caa61c70987c34f9b9ce4e3df85ba5bc3 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Tue, 28 Jan 2014 16:50:27 -0700 Subject: [PATCH] added docs for the tracer logger, fixed url creation --- docs/logging.asciidoc | 10 ++++++++++ src/lib/loggers/tracer.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/logging.asciidoc b/docs/logging.asciidoc index e865fe862..6afb3327e 100644 --- a/docs/logging.asciidoc +++ b/docs/logging.asciidoc @@ -154,6 +154,16 @@ Options: `path`::: `String` -- Location of the file to write log messages to. It is created if it does not exists. Default is `"elasticsearch.log"` +`"tracer"`:: +Logs in a format that can be executed with bash, where everything is commented except the trace commands which are formatted as curl calls. By default all of the urls are rewritten to protect production systems and to making the scripts easier to reuse/send to other people. In order to control the urls written specify the curlHost and curlPort configs. ++ +Options: + +`curlHost`::: +`Sting` -- Default is `"localhost"`. +`curlPort`::: +`Sting` -- Default is `9200`. + `"stream"`:: Send log messages to a WriteableStream + diff --git a/src/lib/loggers/tracer.js b/src/lib/loggers/tracer.js index bedaf2807..1c25a6469 100755 --- a/src/lib/loggers/tracer.js +++ b/src/lib/loggers/tracer.js @@ -39,7 +39,7 @@ Tracer.prototype._formatTraceMessage = function (req) { var originalHost = url.format(_.pick(reqUrl, 'protocol', 'hostname', 'port')); reqUrl.port = this.curlPort; - reqUrl.host = this.curlHost; + reqUrl.hostname = this.curlHost; reqUrl.query = _.defaults(reqUrl.query || {}, { pretty: true }); /* jshint quotmark: double */