Skip to content

Commit 92d551d

Browse files
Only log to file if LOG_FILE is set
Otherwise log to stdout
1 parent 3ef0237 commit 92d551d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@
3333
app.config['MAX_CONTENT_LENGTH'] = 15 * 1024 * 1024 # 15 Mb limit
3434
recaptcha = ReCaptcha(app)
3535

36-
app.config['LOG_FILE'] = 'secure-drop.log'
37-
logging.basicConfig(filename=app.config['LOG_FILE'], level=logging.INFO)
36+
log_file = os.environ.get('LOG_FILE', '')
37+
if log_file:
38+
logging.basicConfig(filename=log_file, level=logging.INFO)
39+
else:
40+
logging.basicConfig(level=logging.INFO)
3841

3942
def parse_form(form):
4043
text = form['message']

0 commit comments

Comments
 (0)