Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[loggers]
keys=root, gunicorn.error, gunicorn.access

[handlers]
keys=console, file


[formatters]
keys=timedRotatingFormatter

[formatter_timedRotatingFormatter]
format=%(asctime)s pid:%(process)d - %(levelname)s: %(message)s
datefmt=%Y-%m-%d %H:%M:%S


[logger_root]
level=NOTSET
handlers=console, file
qualname=root

[logger_gunicorn.error]
level=INFO
handlers=console, file
propagate=1
qualname=gunicorn.error

[logger_gunicorn.access]
level=INFO
handlers=console, file
propagate=0
qualname=gunicorn.access


[handler_console]
level=INFO
class=StreamHandler
formatter=timedRotatingFormatter
args=(sys.stdout, )

[handler_file]
level=DEBUG
class=handlers.TimedRotatingFileHandler
args=('logs/gunicorn.log', 'D', 1, 30)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ services:
networks:
- web_nw
command:
bash -c "flask db upgrade && gunicorn -k gevent -w 4 -b 0.0.0.0:5000 app.run:app"
bash -c "flask db upgrade &&
gunicorn --log-config configs/gunicorn-logging.ini -k gevent -w 4 -b 0.0.0.0:5000 app.run:app"

networks:
web_nw:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def gen_data(data_root='hobbit/static/bootstrap'):


package_data = gen_data()
assert len(package_data) == 27, \
assert len(package_data) == 28, \
'nums of tepl files error, {}'.format(len(package_data))


Expand Down
4 changes: 2 additions & 2 deletions tests/test_hobbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_startproject_cmd_example(self):
'--echo', 'startproject', '-n', 'haha', '--example',
'-p', '1024',
], obj={})
# start + 27 files + 10 dir + 1 end + empty
assert len(result.output.split('\n')) == 1 + 10 + 27 + 1 + 1
# start + 28 files + 11 dir + 1 end + empty
assert len(result.output.split('\n')) == 1 + 28 + 11 + 1 + 1
assert result.exit_code == 0
assert 'example.py' in result.output