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

Eliminate rogue logging.basicConfig calls #6786

Open
gnprice opened this issue Sep 30, 2017 · 4 comments
Open

Eliminate rogue logging.basicConfig calls #6786

gnprice opened this issue Sep 30, 2017 · 4 comments

Comments

@gnprice
Copy link
Member

gnprice commented Sep 30, 2017

The logging.basicConfig function attempts to configure logging globally for the whole program. This can be suitable for a standalone script, but not for part of a large application like our Django app codebase -- if they do anything at all, then they stomp all over the config we've carefully set up in zproject/settings.py.

We have five examples of this outside of scripts, all in zerver/:

zerver/lib/logging_util.py:    logging.basicConfig(format=log_format)
zerver/lib/notifications.py:    logging.basicConfig(filename=settings.DIGEST_LOG_PATH, level=logging.INFO)
zerver/management/commands/email_mirror.py:logging.basicConfig(format=log_format)
zerver/management/commands/process_queue.py:        logging.basicConfig()
zerver/management/commands/runtornado.py:            logging.basicConfig(level=logging.INFO,

Quite possibly they should all just be deleted. This task basically comes down to checking each one and seeing (a) if it's doing anything, and (b) if so, if we want any of what it's doing, and taking care of that some other way.

@zulipbot
Copy link
Member

Hello @zulip/server-production members, this issue was labeled with the area: production label, so you may want to check it out!

@timabbott
Copy link
Sponsor Member

I think it'd be a good idea to attempt to address this before the 1.7 release, so that we only need to carefully recheck that the right stuff is in the right log files after your other logging PR once...

@timabbott
Copy link
Sponsor Member

We've only got a couple left outside scripts/ and tools/:

$ git grep logging.basicConfig zerver/
zerver/lib/notifications.py:    logging.basicConfig(filename=settings.DIGEST_LOG_PATH, level=logging.INFO)
zerver/management/commands/email_mirror.py:logging.basicConfig(format=log_format)
zerver/management/commands/process_queue.py:        logging.basicConfig()
zerver/management/commands/runtornado.py:            logging.basicConfig(level=logging.INFO,

Might be worth putting finishing this and then lint-banning it in zerver/ soon.

@zulipbot
Copy link
Member

zulipbot commented Mar 2, 2018

Hello @gnprice, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days.

You can reclaim this issue or claim any other issue by commenting @zulipbot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

alexmv added a commit to alexmv/zulip that referenced this issue Oct 9, 2020
Its last callsite was removed in e46cbaf.

Also ref zulip#6786.
andersk pushed a commit that referenced this issue Oct 9, 2020
Its last callsite was removed in e46cbaf.

Also ref #6786.
AstonBraham pushed a commit to AstonBraham/zulip that referenced this issue Oct 9, 2020
Its last callsite was removed in e46cbaf.

Also ref zulip#6786.
vishkrish200 pushed a commit to vishkrish200/zulip that referenced this issue Oct 15, 2020
Its last callsite was removed in e46cbaf.

Also ref zulip#6786.
GregoryDRowe pushed a commit to GregoryDRowe/zulip that referenced this issue Oct 20, 2020
Its last callsite was removed in e46cbaf.

Also ref zulip#6786.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants