From 2124661cee43affc660cb08f07af26d68004c35d Mon Sep 17 00:00:00 2001 From: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> Date: Sat, 2 Nov 2019 02:22:58 +0300 Subject: [PATCH 1/2] Update faq with examples of grepping the log --- docs/faq.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/faq.md b/docs/faq.md index dd92d310e..7652ec278 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -55,6 +55,44 @@ If you have restricted pairs in your whitelist, you'll get a warning message in If you're an "International" Customer on the Bittrex exchange, then this warning will probably not impact you. If you're a US customer, the bot will fail to create orders for these pairs, and you should remove them from your Whitelist. +### How do I search the bot logs for something? + +By default, the bot writes its log into stderr stream. This is implemented this way so that you can easily separate the bot's diagnostics messages from Backtesting, Edge and Hyperopt results, output from other various Freqtrade utility subcommands, as well as from the output of your custom `print()`'s you may have inserted into your strategy. So if you need to search the log messages with the grep utility, you need to redirect stderr to stdout and disregard stdout. + +* In unix shells, this normally can be done as simple as: +```shell +freqtrade --some-options 2>&1 >/dev/null | grep 'something' +``` +(note, `2>&1` and `>/dev/null` should be written in this order) + +* Bash interpreter also supports so called process substitution syntax, you can grep the log for a string with it as: +```shell +$ freqtrade --some-options 2> >(grep 'something') >/dev/null +``` +or +```shell +$ freqtrade --some-options 2> >(grep -v 'something' 1>&2) +``` + +* You can also write the copy of Freqtrade log messages to a file with the `--logfile` option: +```shell +$ freqtrade --logfile /path/to/mylogfile.log --some-options +``` +and then grep it as: +```shell +$ cat /path/to/mylogfile.log | grep 'something' +``` +or even on the fly, as the bot works and the logfile grows: +```shell +$ tail -f /path/to/mylogfile.log | grep 'something' +``` +from a separate terminal window. + +On Windows, the `--logfilename` option is also supported by Freqtrade and you can use the `findstr` command to search the log for the string of interest: +``` +> type \path\to\mylogfile.log | findstr "something" +``` + ## Hyperopt module ### How many epoch do I need to get a good Hyperopt result? From e9af6b393f5ff7aa34e2e0d63879ced22741343e Mon Sep 17 00:00:00 2001 From: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> Date: Sat, 2 Nov 2019 02:32:57 +0300 Subject: [PATCH 2/2] Fix typo --- docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 7652ec278..7fdd54958 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -61,7 +61,7 @@ By default, the bot writes its log into stderr stream. This is implemented this * In unix shells, this normally can be done as simple as: ```shell -freqtrade --some-options 2>&1 >/dev/null | grep 'something' +$ freqtrade --some-options 2>&1 >/dev/null | grep 'something' ``` (note, `2>&1` and `>/dev/null` should be written in this order)