logdna / python

A python package for sending logs to LogDNA
MIT License
48 stars 35 forks source link

Django unable to start #103

Closed PavelPancocha closed 1 year ago

PavelPancocha commented 1 year ago

From version 1.18.8 I am not able to start up the django project with logdna

I think some blocking thread from these changes could be the reason for it.

1.18.7 works fine.

shawkinsmezmo commented 1 year ago

Hi @PavelPancocha. I'm investigating the django startup issue. The changes in question were implemented in order to address an issue with version 1.18.7 where the python logger would silently drop logs due to improper locking semantics around shared state. Would you be able to share an example of your logging config from the django project in question? This will help me to more quickly reproduce the issue in question. Thanks!

shawkinsmezmo commented 1 year ago

Hi @PavelPancocha We have a fix en route that should hopefully address this issue. I apologize for the inconvenience and appreciate your patience as we work through this.

PavelPancocha commented 1 year ago

Thank you @shawkinsmezmo - if needable, I can try to prepare some "minimum example app" that would show the issue. From what I tested so far the config doesn't play a role here. Thank you!

dbartenstein commented 1 year ago

@shawkinsmezmo do you already have an ETA for the fix? Thanks a lot! :bow:

shawkinsmezmo commented 1 year ago

Hi @dbartenstein. @PavelPancocha - Can you give the latest package a try and let me know if it resolves your issues? Thanks!

PavelPancocha commented 1 year ago

@shawkinsmezmo Unfortunatelly, doesnt seems to work. Our docker build hangs on python3 manage.py collectstatic

shawkinsmezmo commented 1 year ago

@PavelPancocha Interesting. I tested the latest release specifically with Django. Can you confirm the version that you tested with? There were two releases that went out in rapid succession, so just want to confirm that you tested against the latest one.

PavelPancocha commented 1 year ago

django==3.2.20

If you will not be able to reproduce it, I should have tomorrow some time to try to compile some "minimum example"

shawkinsmezmo commented 1 year ago

@PavelPancocha I meant can you confirm the version of the LogDNA python logging client that you tested with? It should be version 1.18.11

PavelPancocha commented 1 year ago

Hi, @shawkinsmezmo

I updated my Docker file with this:

RUN pip show django
RUN pip show logdna
RUN timeout 20 python3 manage.py check || true
RUN python3 -m trace --trace manage.py check

Fails on check

What I get (very long): https://drive.google.com/file/d/1M50gLE9h0OQzoRcbgQ2Ljjkjm6p6M20P/view?usp=sharing

As you can see, it got clipped, but it could lead you somewhere

PavelPancocha commented 1 year ago

I see the part with pip show was cut, but yes, it is Django 3.2.20 & logdna 1.18.11

shawkinsmezmo commented 1 year ago

@PavelPancocha @dbartenstein Can you give version 1.18.12 a try? I traced the root cause of the issue to the logdna handler overwriting a variable of the base logging.Handler class, which should be addressed with the latest release.

PavelPancocha commented 1 year ago

@shawkinsmezmo seems to solve the problem! Thanks 🙇🏻‍♂️

shawkinsmezmo commented 1 year ago

Closing this issue as resolved. Thanks for everyone's help on this.