Skip to content

flask logging to file #446

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

Closed
wants to merge 1 commit into from
Closed

flask logging to file #446

wants to merge 1 commit into from

Conversation

urirot
Copy link
Collaborator

@urirot urirot commented Oct 20, 2021

No description provided.

@c-simpson
Copy link
Collaborator

@urirot I'm not sure what this does for us other than write it to the file. I find getting the module to be useful.

EXISTING

[2021-10-25 22:22:00,466] INFO in clean_and_load_data:    - Cleaned DF
[2021-10-25 22:22:01,239] INFO in clean_and_load_data:    - Normalized DF
[2021-10-25 22:22:01,849] INFO in clean_and_load_data:    - Finish load_paws_data on: salesforcecontacts-2021-09-20--19-07-24.csv
[2021-10-25 22:22:01,854] INFO in clean_and_load_data: Running load_paws_data on: shelterluvpeople-2021-09-20--20-47-38.csv
[2021-10-25 22:22:02,166] INFO in clean_and_load_data:    - Populated DF
[2021-10-25 22:22:02,186] INFO in clean_and_load_data:    - Cleaned DF
[2021-10-25 22:22:02,638] INFO in clean_and_load_data:    - Normalized DF

127.0.0.1 - - [25/Oct/2021 22:34:39] "GET /api/statistics HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2021 22:34:44] "GET /api/rfm/labels HTTP/1.1" 200 -

THIS PR (at INFO)

$ tail -f error.log
2021-10-25 22:28:23,513 INFO app :    - Populated DF
2021-10-25 22:28:23,557 INFO app :    - Cleaned DF
2021-10-25 22:28:24,313 INFO app :    - Normalized DF
2021-10-25 22:28:25,013 INFO app :    - Finish load_paws_data on: salesforcecontacts-2021-09-20--19-07-24.csv
2021-10-25 22:28:25,013 INFO app : Running load_paws_data on: shelterluvpeople-2021-09-20--20-47-38.csv
2021-10-25 22:28:25,348 INFO app :    - Populated DF
2021-10-25 22:28:25,363 INFO app :    - Cleaned DF
2021-10-25 22:28:25,807 INFO app :    - Normalized DF

2021-10-25 22:31:17,808 INFO werkzeug : 127.0.0.1 - - [25/Oct/2021 22:31:17] "POST /api/execute HTTP/1.1" 200 -
2021-10-25 22:31:17,851 INFO app : Start returning file list
2021-10-25 22:31:17,852 INFO werkzeug : 127.0.0.1 - - [25/Oct/2021 22:31:17] "GET /api/listCurrentFiles HTTP/1.1" 200 -

The werkzeug comments seem to have a lot of unnecessary duplication.

Could we leave as-is and add a handler to (also) write to a file? I like being to see it the logs in the console when I'm debugging.

@urirot
Copy link
Collaborator Author

urirot commented Oct 26, 2021

I think this is configurable and can also output to the console + save to the file.
But this is a native way of doing this with flask. don't think it's better than writing our own handler?

@c-simpson
Copy link
Collaborator

Now doing structured logging to stdout (#494 ) for ingestion by CfP logging system.

@c-simpson c-simpson closed this Jan 7, 2023
@kfettich kfettich deleted the logging-to-file branch March 1, 2023 00:06
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

Successfully merging this pull request may close these issues.

2 participants