Page MenuHomePhabricator

Evaluate usefulness of linkrecommendation printed logging on each request
Open, Needs TriagePublic

Description

See these logs for an example.

Are these logs useful to keep for 90 days in Logstash?

They are not being produced as part of mwaddlink logging facilities, but instead being generated by a print statement which makes me think these logs may be unintentionally generated.

Event Timeline

Tgr added a subscriber: Tgr.

The same method is used for web and CLI requests (both via @click and via __main__). For web the printing should be removed. For CLI indenting should be restored.

The same method is used for web and CLI requests (both via @click and via __main__). For web the printing should be removed. For CLI indenting should be restored.

My understanding was that has_app_context() prevents printing in the web request context.

I have very limited experience with Flask but the documentation says "The application context keeps track of the application-level data during a request, CLI command, or other activity." so my read was that has_app_context() is basically always true, unless you are very early in the lifecycle or invoking the class in a strange way.

@Tgr Can this be moved to Triaged? It appears no commitment is being made to it

I think we should just do this, it's about moving one line of code. Maybe a good task for @mewoph or @Sgs if they are interested in how the local setup & deployment process for the link recommendation service works.