From c1441f72cd216d92426e9c6f7339dfa430fb5787 Mon Sep 17 00:00:00 2001 From: James Bloom <733179+jamesdbloom@users.noreply.github.com> Date: Sun, 4 Nov 2018 14:14:10 +0000 Subject: [PATCH] added more information about log level --- README.md | 12 ++++++++---- index.js | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8bacfe4..2de7dd7 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,15 @@ Then you can use either the `start_mockserver` or `stop_mockserver` functions as ```js mockserver.start_mockserver({ - serverPort: 1080 - verbose: true + serverPort: 1080, + trace: true }); // do something mockserver.stop_mockserver({ - serverPort: 1080 - verbose: true + serverPort: 1080, + trace: true }); ``` @@ -79,6 +79,10 @@ grunt.initConfig({ grunt.loadNpmTasks('mockserver-node'); ``` +## Request Log + +**Note:** The request log will only be captured in MockServer if the log level is `INFO` (or more verbose, i.e. `DEBUG` or `TRACE`) therefore to capture the request log and use the `/retrieve` endpoint ensure either the option `trace: true` or the command line switch `--verbose` is set. + ### Options #### options.serverPort diff --git a/index.js b/index.js index 24231e9..1a32669 100644 --- a/index.js +++ b/index.js @@ -181,6 +181,10 @@ module.exports = (function () { commandLineOptions.push("-proxyRemoteHost"); commandLineOptions.push(options.proxyRemoteHost); } + if (options.logLevel) { + commandLineOptions.push("-logLevel"); + commandLineOptions.push(options.logLevel); + } if (options.verbose) { console.log('Running \'java ' + commandLineOptions.join(' ') + '\''); }