Skip to content

Error in Syslog Renderer #10990

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
ericholscher opened this issue Jan 3, 2024 · 4 comments
Closed

Error in Syslog Renderer #10990

ericholscher opened this issue Jan 3, 2024 · 4 comments
Labels
Bug A bug

Comments

@ericholscher
Copy link
Member

ericholscher commented Jan 3, 2024

docs@web-extra-i-030bb0c0ac41975cd(com):~/checkouts/readthedocs.org$ django-admin migrate redirects 0006
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1100, in emit
    msg = self.format(record)
  File "/usr/lib/python3.10/logging/__init__.py", line 943, in format
    return fmt.format(record)
  File "/home/docs/lib/python3.10/site-packages/structlog/stdlib.py", line 1087, in format
    ed = p(logger, meth_name, cast(EventDict, ed))
  File "/home/docs/checkouts/readthedocs.org/readthedocs/core/logs.py", line 115, in __call__
    + self._level_to_color.get(level, "")
AttributeError: 'SysLogRenderer' object has no attribute '_level_to_color'

Noticed this exception when running any console command on readthedocs.com. It didn't happen when running on readthedocs.org servers, which is odd since they're mostly identical.

@stsewd
Copy link
Member

stsewd commented Jan 4, 2024

I'm seeing some errors related to logging on .org as well when running commands from the shell.

Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/handlers.py", line 971, in emit
    msg = self.format(record)
  File "/usr/lib/python3.10/logging/__init__.py", line 943, in format
    return fmt.format(record)
  File "/home/docs/lib/python3.10/site-packages/structlog/stdlib.py", line 1087, in format
    ed = p(logger, meth_name, cast(EventDict, ed))
  File "/home/docs/checkouts/readthedocs.org/readthedocs/core/logs.py", line 115, in __call__
    + self._level_to_color.get(level, "")
AttributeError: 'SysLogRenderer' object has no attribute '_level_to_color'

@stsewd stsewd added the Bug A bug label Jan 4, 2024
@ericholscher
Copy link
Member Author

Well that's good. I wasn't seeing them yesterday, but likely just need to remove that line in the logger 👍

@ericholscher
Copy link
Member Author

Pinning dep for now. Not sure where this core/logs logic came from, but not sure we need it anymore.

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

Successfully merging a pull request may close this issue.

3 participants