File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ ENV DEFAULT_THEME=wirecloud.defaulttheme
66ENV FORWARDED_ALLOW_IPS=*
77ENV DB_HOST=
88ENV DB_PORT=5432
9+ ENV LOGLEVEL=info
910
1011RUN apt-get update && \
1112 apt-get install -y libmemcached-dev gosu && \
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ services:
4646 - memcached
4747 environment :
4848 - DEBUG=False
49+ - LOGLEVEL=INFO
4950 # - DEFAULT_THEME=wirecloud.defaulttheme
5051 - DB_HOST=postgres
5152 - DB_PASSWORD=wirepass # Change this password!
Original file line number Diff line number Diff line change @@ -27,9 +27,19 @@ case "$1" in
2727
2828 # allow the container to be started with `--user`
2929 if [ " $( id -u) " = ' 0' ]; then
30- gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS} " -w 2 -b :8000
30+ exec gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application \
31+ --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS} " \
32+ --workers 2 \
33+ --bind 0.0.0.0:8000 \
34+ --log-file - \
35+ --log-level ${LOGLEVEL}
3136 else
32- /usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS} " -w 2 -b :8000
37+ exec /usr/local/bin/gunicorn wirecloud_instance.wsgi:application \
38+ --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS} " \
39+ --workers 2 \
40+ --bind 0.0.0.0:8000 \
41+ --log-file - \
42+ --log-level ${LOGLEVEL}
3343 fi
3444 ;;
3545esac
Original file line number Diff line number Diff line change 193193 )
194194
195195DATA_UPLOAD_MAX_MEMORY_SIZE = 262144000
196+
197+ LOGGING = {
198+ 'version' : 1 ,
199+ 'disable_existing_loggers' : False ,
200+ 'filters' : {
201+ 'require_debug_false' : {
202+ '()' : 'django.utils.log.RequireDebugFalse'
203+ },
204+ 'skip_unreadable_posts' : {
205+ '()' : 'wirecloud.commons.utils.log.SkipUnreadablePosts' ,
206+ }
207+ },
208+ 'handlers' : {
209+ 'console' : {
210+ 'level' : 'INFO' ,
211+ 'class' : 'logging.StreamHandler' ,
212+ },
213+ 'mail_admins' : {
214+ 'level' : 'ERROR' ,
215+ 'filters' : ['require_debug_false' , 'skip_unreadable_posts' ],
216+ 'class' : 'django.utils.log.AdminEmailHandler'
217+ }
218+ },
219+ 'loggers' : {
220+ '' : {
221+ 'handlers' : ['console' ],
222+ },
223+ 'django.request' : {
224+ 'handlers' : ['console' , 'mail_admins' ],
225+ 'level' : 'ERROR' ,
226+ 'propagate' : False ,
227+ },
228+ }
229+ }
Original file line number Diff line number Diff line change 1-
21ARG PYTHON_VERSION=3.6-stretch
32FROM python:${PYTHON_VERSION}
43
@@ -17,7 +16,8 @@ MAINTAINER WireCloud Team <wirecloud@conwet.com>
1716
1817ENV DEFAULT_THEME=wirecloud.defaulttheme \
1918 FORWARDED_ALLOW_IPS=* \
20- DB_PORT=5432
19+ DB_PORT=5432 \
20+ LOGLEVEL=info
2121
2222RUN apt-get update && \
2323 apt-get install -y libmemcached-dev gosu && \
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ services:
4646 - memcached
4747 environment :
4848 - DEBUG=False
49+ - LOGLEVEL=INFO
4950 # - DEFAULT_THEME=wirecloud.defaulttheme
5051 - DB_HOST=postgres
5152 - DB_PASSWORD=wirepass # Change this password!
Original file line number Diff line number Diff line change @@ -54,9 +54,19 @@ case "$1" in
5454
5555 # allow the container to be started with `--user`
5656 if [ " $( id -u) " = ' 0' ]; then
57- gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS} " -w 2 -b :8000
57+ exec gosu wirecloud /usr/local/bin/gunicorn wirecloud_instance.wsgi:application \
58+ --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS} " \
59+ --workers 2 \
60+ --bind 0.0.0.0:8000 \
61+ --log-file - \
62+ --log-level ${LOGLEVEL}
5863 else
59- /usr/local/bin/gunicorn wirecloud_instance.wsgi:application --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS} " -w 2 -b :8000
64+ exec /usr/local/bin/gunicorn wirecloud_instance.wsgi:application \
65+ --forwarded-allow-ips " ${FORWARDED_ALLOW_IPS} " \
66+ --workers 2 \
67+ --bind 0.0.0.0:8000 \
68+ --log-file - \
69+ --log-level ${LOGLEVEL}
6070 fi
6171 ;;
6272esac
Original file line number Diff line number Diff line change 194194 )
195195
196196DATA_UPLOAD_MAX_MEMORY_SIZE = 262144000
197+
198+ LOGGING = {
199+ 'version' : 1 ,
200+ 'disable_existing_loggers' : False ,
201+ 'filters' : {
202+ 'require_debug_false' : {
203+ '()' : 'django.utils.log.RequireDebugFalse'
204+ },
205+ 'skip_unreadable_posts' : {
206+ '()' : 'wirecloud.commons.utils.log.SkipUnreadablePosts' ,
207+ }
208+ },
209+ 'handlers' : {
210+ 'console' : {
211+ 'level' : 'INFO' ,
212+ 'class' : 'logging.StreamHandler' ,
213+ },
214+ 'mail_admins' : {
215+ 'level' : 'ERROR' ,
216+ 'filters' : ['require_debug_false' , 'skip_unreadable_posts' ],
217+ 'class' : 'django.utils.log.AdminEmailHandler'
218+ }
219+ },
220+ 'loggers' : {
221+ '' : {
222+ 'handlers' : ['console' ],
223+ },
224+ 'django.request' : {
225+ 'handlers' : ['console' , 'mail_admins' ],
226+ 'level' : 'ERROR' ,
227+ 'propagate' : False ,
228+ },
229+ }
230+ }
You can’t perform that action at this time.
0 commit comments