Skip to content

Commit

Permalink
Default docker to log into log-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Apr 21, 2020
1 parent 102c4cf commit 87f1060
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: '3'
services:
freqtrade:
image: freqtradeorg/freqtrade:master
# image: freqtradeorg/freqtrade:develop
# Build step - only needed when additional dependencies are needed
# build:
# context: .
Expand All @@ -14,7 +15,7 @@ services:
# Default command used when running `docker compose up`
command: >
trade
--logfile /freqtrade/user_data/freqtrade.log
--logfile /freqtrade/user_data/logs/freqtrade.log
--db-url sqlite:////freqtrade/user_data/tradesv3.sqlite
--config /freqtrade/user_data/config.json
--strategy SampleStrategy
4 changes: 2 additions & 2 deletions freqtrade/configuration/directory_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def create_userdata_dir(directory: str, create_dir: bool = False) -> Path:
:param create_dir: Create directory if it does not exist.
:return: Path object containing the directory
"""
sub_dirs = ["backtest_results", "data", "hyperopts", "hyperopt_results", "notebooks",
"plot", "strategies", ]
sub_dirs = ["backtest_results", "data", "hyperopts", "hyperopt_results", "logs",
"notebooks", "plot", "strategies", ]
folder = Path(directory)
if not folder.is_dir():
if create_dir:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_directory_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_create_userdata_dir(mocker, default_conf, caplog) -> None:
md = mocker.patch.object(Path, 'mkdir', MagicMock())

x = create_userdata_dir('/tmp/bar', create_dir=True)
assert md.call_count == 8
assert md.call_count == 9
assert md.call_args[1]['parents'] is False
assert log_has(f'Created user-data directory: {Path("/tmp/bar")}', caplog)
assert isinstance(x, Path)
Expand Down
Empty file added user_data/logs/.gitkeep
Empty file.

0 comments on commit 87f1060

Please sign in to comment.