log4mongo / log4mongo-python

python logging handler for mongo database
http://log4mongo.org
Other
111 stars 37 forks source link

BufferedMongoHandler calls threading.Thread with deamon=True raises TypeError #30

Closed StevenOP closed 7 years ago

StevenOP commented 7 years ago

Unfortunately, calling threading.Thread with deamon=True (L254 of log4mongo/handlers.py) does not work in python 2.7.14. Initializing a BufferedMongoHandler instance raises the following error: TypeError: __init__() got an unexpected keyword argument 'daemon'

From what I understood, adding deamon=True is only required in Python >3.3. Everything seems to run fine when removing deamon=True from the call.

Is it maybe possible to do a quick-fix and test for python version to see whether or not deamon=True should be added to the call of threading.Thread?

(I can fix it myself for local use, but it's really useful to be able to install log4mongo on a remote server using pip)

oz123 commented 7 years ago

@StevenOP a PR is most welcomed!

tiendan commented 7 years ago

Hi @oz123,

Just bumped into this issue too, and sent my PR.

Cheers, Onur

tiendan commented 7 years ago

Hello @oz123 ,

Thanks for the merge 👍 This issue should be resolved with the next version of the library. Just one question, are you going to modify the version number later on?

We are about to push some code to our servers, and it would be great to have this fix applied in a new version so that we can include it too 🙂

Cheers, Onur

oz123 commented 7 years ago

Hi, I intend to realease a new version after tomorrow. If everything goes well you will get your version bump.

I am in the Barcelona Plone Conference, come say hello to other python developers!

oz123 commented 7 years ago

Released version 1.6.2 https://pypi.python.org/pypi/log4mongo/1.6.2

tiendan commented 7 years ago

Thanks so much!

I would love to join the conference and your training, but I'm working during the day and it's impossible to take some days off ☚ī¸ Enjoy the city & the conference!