-
Notifications
You must be signed in to change notification settings - Fork 549
Logs are not being sent / visualized #4415
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
Comments
Hey @LuisSanchez, thanks for raising this issue with us. From the logs you provided, it looks like a bit like the SDK is being initialized multiple times; I also don't see the log message I would expect to see when the SDK is sending a log to Sentry. How exactly are you running this code? Would you be able to provide a full reproduction? I attempted to reproduce the problem you are observing with a simpler example but was unable to; I have uploaded the code and steps I followed to this repository. Does that code work for you? If it does, would you be able to share what you are doing differently, or perhaps make a PR against my repository with some code which does reproduce the issue? Thanks in advance. |
Hello @szokeasaurusrex! I tried the solution on your repo and it does works. |
Hey @szokeasaurusrex, I have forked your example and attempted to partially reproduce one of the errors where Info log is not sent to Sentry when using main_logger.pyRun uv run main_logger.py. Uses logging.Logger(name) that creates a new logger for the same module each time it is called. This is bad practice. Info and Warning get logged to Sentry main_get_logger.pyRun uv run main_get_logger.py. Uses logging.getLogger(name) uses a singleton patter and returns the same instance every time it is called with the same name. Info does NOT get logged into Sentry. Evidence on Sentry![]() Next stepsI will try to fully reproduce the initial error where no logs are sent to the UI. Already tried with |
Hey @LuisSanchez, I believe I've figured out why only the Specifically, the Sentry SDK's logging integration honors the logger's log level. When you use In the Next stepsSince this behavior appears to be expected, I am going to close this issue for now. I will, however, make sure we update this section of our Python Logs docs to clarify that the logging integration respects the logger's configured level. Please check what log level you have set for your application and adjust it accordingly in order to see logs in Sentry. You can do so by calling Note about
|
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.29.1
Steps to Reproduce
So far I've tried this with no luck, no logs are sent to the UI:
settings.py
random_file.py
Errors are sent correctly.
I'm using the Developer version.
I have followed up this guide:
https://docs.sentry.io/platforms/python/logs/
Debug
pip freeze --all
aiohappyeyeballs==2.6.1
aiohttp==3.11.18
aiosignal==1.3.2
alembic==1.8.1
annotated-types==0.7.0
ansicon==1.89.0
anyio==4.9.0
appnope==0.1.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asgiref==3.8.1
asttokens==3.0.0
async-lru==2.0.5
async-timeout==5.0.1
attrs==23.2.0
autoflake==2.3.1
autopage==0.5.2
azure-core==1.25.0
azure-identity==1.10.0
azure-storage-blob==12.13.1
babel==2.17.0
bcrypt==4.3.0
beautifulsoup4==4.13.4
black==25.1.0
bleach==6.2.0
blessed==1.20.0
boto3==1.34.134
botocore==1.34.134
certifi==2021.10.8
cffi==1.15.0
cfgv==3.4.0
charset-normalizer==2.0.12
click==8.2.0
cliff==4.0.0
cmaes==0.10.0
cmd2==2.4.2
colorama==0.4.4
colorlog==6.8.2
comm==0.2.2
croniter==2.0.5
cryptography==38.0.4
cvxpy==1.2.1
cycler==0.12.1
dataclasses-json==0.6.7
debugpy==1.8.14
decorator==5.2.1
defusedxml==0.7.1
Deprecated==1.2.18
dirtyjson==1.0.8
distlib==0.3.9
distro==1.9.0
dj-database-url==0.5.0
dj-rest-auth==7.0.1
Django==5.1.6
django-allauth==65.3.1
django-bulk-update-or-create==0.3.0
django-cors-headers==3.11.0
django-debug-toolbar==5.0.1
django-environ==0.8.1
django-extensions==3.1.5
django-filter==21.1
django-i18n==1.0.5
django-picklefield==3.1
django-q-sentry==0.1.6
django-q2==1.6.2
django-storages==1.13.1
django-tenants==3.7.0
django-unfold==0.43.0
djangorestframework==3.14.0
djangorestframework-api-key==3.0.0
djangorestframework-simplejwt==5.3.1
ecos==2.0.10
environ==1.0
et-xmlfile==1.1.0
exceptiongroup==1.2.0
executing==2.2.0
fastjsonschema==2.21.1
fido2==1.2.0
filelock==3.18.0
flake8==7.1.1
fonttools==4.48.1
fqdn==1.5.1
freezegun==1.5.1
frozenlist==1.6.0
fsspec==2025.3.2
gevent==21.12.0
graphviz==0.20
greenlet==1.1.2
gunicorn==23.0.0
gurobipy==11.0.3
h11==0.16.0
httpcore==1.0.9
httpie==3.1.0
httpx==0.27.2
identify==2.6.10
idna==3.3
importlib-metadata==4.12.0
iniconfig==2.0.0
ipykernel==6.29.5
ipython==8.23.0
ipython-memory-usage==1.8.3
ipywidgets==8.1.7
isodate==0.6.1
isoduration==20.11.0
isort==6.0.0
jedi==0.19.2
Jinja2==3.1.6
jinxed==1.2.0
jiter==0.10.0
jmespath==1.0.1
joblib==1.4.2
json5==0.12.0
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2025.4.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.12.0
jupyter-lsp==2.2.5
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyter_server==2.16.0
jupyter_server_terminals==0.5.3
jupyterlab==4.1.1
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.3
jupyterlab_widgets==3.0.15
kiwisolver==1.4.5
llama-index==0.10.38
llama-index-agent-openai==0.2.9
llama-index-cli==0.1.13
llama-index-core==0.10.68.post1
llama-index-embeddings-openai==0.1.11
llama-index-indices-managed-llama-cloud==0.1.6
llama-index-legacy==0.9.48.post4
llama-index-llms-openai==0.1.20
llama-index-multi-modal-llms-openai==0.1.9
llama-index-program-openai==0.1.7
llama-index-question-gen-openai==0.1.3
llama-index-readers-database==0.1.4
llama-index-readers-file==0.1.33
llama-index-readers-llama-parse==0.1.6
llama-parse==0.4.9
llamaindex-py-client==0.1.19
Mako==1.3.2
Markdown==3.3.6
MarkupSafe==2.1.5
marshmallow==3.26.1
matplotlib==3.5.0
matplotlib-inline==0.1.7
mccabe==0.7.0
memory_profiler==0.60.0
mistune==3.1.3
model-bakery==1.20.0
msal==1.28.0
msal-extensions==1.1.0
msrest==0.7.1
multidict==6.0.2
mypy_extensions==1.1.0
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
nest-asyncio==1.6.0
networkx==3.4.2
nltk==3.9.1
nodeenv==1.9.1
notebook==7.1.3
notebook_shim==0.2.4
numpy==1.26.4
oauthlib==3.2.0
openai==1.71.0
openpyxl==3.1.0
optuna==2.10.0
osqp==1.0.4
overrides==7.7.0
packaging==24.1
pandas==1.5.3
pandocfilters==1.5.1
paramiko==3.4.0
parso==0.8.4
pathspec==0.12.1
patsy==1.0.1
pbr==6.0.0
pexpect==4.9.0
pillow==10.2.0
pip==25.1.1
platformdirs==4.3.8
pluggy==1.4.0
polars==1.7.1
portalocker==2.5.1
pre_commit==4.1.0
prettytable==3.9.0
prometheus_client==0.22.0
prompt_toolkit==3.0.51
propcache==0.3.1
psutil==5.9.2
psycopg2==2.9.3
psycopg2-binary==2.9.3
ptyprocess==0.7.0
pure_eval==0.2.3
pyaml==21.10.1
pyarrow==15.0.2
pycodestyle==2.12.1
pycparser==2.21
pydantic==2.7.1
pydantic_core==2.18.2
pydotplus==2.0.2
pyflakes==3.2.0
Pygments==2.18.0
PyJWT==2.3.0
PyNaCl==1.5.0
pyodbc==5.1.0
pyparsing==3.0.8
pypdf==4.3.1
pyperclip==1.8.2
PySocks==1.7.1
pytest==7.4.4
pytest-django==4.7.0
pytest-mock==3.14.0
python-crontab==3.0.0
python-dateutil==2.8.2
python-json-logger==3.3.0
python3-openid==3.2.0
pytz==2022.1
pyxlsb==1.0.9
PyYAML==6.0.1
pyzmq==26.4.0
qrcode==8.2
qtconsole==5.6.1
QtPy==2.4.3
redis==3.5.3
referencing==0.36.2
regex==2024.11.6
requests==2.31.0
requests-oauthlib==1.3.1
requests-toolbelt==0.9.1
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.25.0
s3transfer==0.10.4
scikit-learn==1.3.2
scikit-optimize==0.10.2
scipy==1.13.1
scs==3.2.7.post2
seaborn==0.11.0
Send2Trash==1.8.3
sentry-sdk==2.29.1
setuptools==80.3.1
setuptools-scm==8.3.1
six==1.16.0
sniffio==1.3.1
soupsieve==2.7
SQLAlchemy==2.0.41
sqlparse==0.4.2
stack-data==0.6.3
statsmodels==0.14.3
stevedore==5.1.0
striprtf==0.0.26
tabulate==0.8.10
tenacity==8.5.0
terminado==0.18.1
threadpoolctl==3.1.0
tiktoken==0.9.0
tinycss2==1.4.0
tokenize_rt==6.1.0
tomli==2.0.1
tornado==6.5
tqdm==4.66.1
traitlets==5.14.3
types-python-dateutil==2.9.0.20250516
typing-inspect==0.9.0
typing_extensions==4.11.0
tzdata==2022.7
uri-template==1.3.0
urllib3==2.2.3
virtualenv==20.31.2
wcwidth==0.2.5
webcolors==24.11.1
webencodings==0.5.1
websocket-client==1.8.0
whitenoise==6.2.0
widgetsnbextension==4.0.14
wincertstore==0.2
wrapt==1.17.2
xlrd==2.0.1
XlsxWriter==3.1.2
yarl==1.20.0
zipp==3.8.1
zope.event==5.0
zope.interface==7.2
Expected Result
To see logs on the UI
Actual Result
Nothing, no logs.
The text was updated successfully, but these errors were encountered: