added docs for the tracer logger, fixed url creation

This commit is contained in:
Spencer Alger
2014-01-28 16:50:27 -07:00
parent 513486f372
commit 93c4ff2caa
2 changed files with 11 additions and 1 deletions

View File

@ -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 <a href="http://nodejs.org/api/stream.html#stream_class_stream_writable">WriteableStream</a>
+

View File

@ -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 */