Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger repeats logs #432

Open
jacob-lee opened this issue Jul 25, 2020 · 4 comments
Open

Logger repeats logs #432

jacob-lee opened this issue Jul 25, 2020 · 4 comments

Comments

@jacob-lee
Copy link
Collaborator

jacob-lee commented Jul 25, 2020

Logging is repeating messages. Perhaps handlers are being added more than once?

Python: 3.8
Psiturk: github master today
Reproduction:

conda env create --name testloggerrepeat python=3.8
conda activate testloggerrepeat
pip install git+https://github.com/NYUCCL/psiTurk.git
psiturk-setup-example;

# Either modify logging level, or change level logged in my_custom_view's; I did the latter

cd psiturk-example; 
psiturk -e 'server on'; 
curl http://127.0.0.1:22362/my_custom_view
cat server.log

Correct output:
[2020-07-25 14:10:33 -0400] [15478] [ERROR] Reached /my_custom_view

Actual output:

[2020-07-25 14:10:33 -0400] [15478] [ERROR] Reached /my_custom_view
2020-07-25 14:10:33,929 Reached /my_custom_view
@jacob-lee jacob-lee reopened this Jul 25, 2020
@deargle
Copy link
Collaborator

deargle commented May 3, 2021

The first one is a log from gunicorn, and the second is from flask. I wrestled with this again for a while with a recent PR (https://github.com/NYUCCL/psiTurk/pull/483/files), but I think I decided it was necessary to have both, I can't remember. But flask routes need to be able to log, and so does gunicorn.

@jacob-lee
Copy link
Collaborator Author

Can they be separated into two log files then?

@deargle
Copy link
Collaborator

deargle commented May 4, 2021 via email

@jacob-lee
Copy link
Collaborator Author

jacob-lee commented May 4, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants