question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging does not work

See original GitHub issue

Hello,

I’m using sentry (7.6.2) and sentry-ldap-auth (1.0), with:

[root@charlotte1 ~]# /sentry/env/bin/pip list | grep django
django-auth-ldap (1.2.7)
django-bitfield (1.7.1)
django-crispy-forms (1.4.0)
django-jsonfield (0.9.13)
django-paging (0.2.5)
django-picklefield (0.3.1)
django-recaptcha (1.0.4)
django-social-auth (0.7.28)
django-statsd-mozilla (0.3.14)
django-sudo (1.1.3)
django-templatetag-sugar (1.0)
djangorestframework (2.3.14)
pytest-django (2.8.0)

Also, I’m using in /etc/sentry/sentry.conf.py:

import logging
logger = logging.getLogger('django_auth_ldap')
logger.addHandler(logging.StreamHandler())
logger.setLevel('DEBUG')

But there is any logging generetady by the supervisord about the login

[root@charlotte1 ~]# egrep '\[|log' /etc/supervisord.d/sentry.ini
[program:sentry-web]
stdout_logfile=/logs/sentry/sentry-web.log
stderr_logfile=/logs/sentry/sentry-web-err.log
[program:sentry-worker]
stdout_logfile=/logs/sentry/sentry-worker.log
stderr_logfile=/logs/sentry/sentry-worker-err.log

There is something missing?

Thanks!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
dirkdevriendtcommented, Oct 20, 2016

Same here. Ironically, the logging setup in sentry is a bit obscure, but basically the problem is that LOGGING exists already, so I had success with the following lines in sentry.conf.py:

LOGGING['overridable'] = ['sentry', 'django_auth_ldap']
LOGGING['loggers']['django_auth_ldap'] = {
        'handlers': ['console']
}

… and then starting the web server with ‘–loglevel DEBUG’

references:

1reaction
jirutkacommented, Mar 26, 2016

@tiago-cruz-movile Try to add the following snippet to sentry.conf.py:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
        }
    },
    'loggers': {
        'django': {
            'handlers': ['console'],
            'level': 'DEBUG'
        }
    }
}

import logging
logger = logging.getLogger('django_auth_ldap')
logger.addHandler(logging.StreamHandler())
logger.setLevel('DEBUG')
Read more comments on GitHub >

github_iconTop Results From Across the Web

logging - Python Logger not working - Stack Overflow
The problem is that the logger's level is still set to the default. So the logger discards the message before it even gets...
Read more >
How to Get Started with Logging in Python - Better Stack
Logging is an invaluable tool in every developer's toolbox when developing software. It provides a reliable means of recording and tracking ...
Read more >
Logging HOWTO — Python 3.11.1 documentation
Author, Vinay Sajip ,. Basic Logging Tutorial: Logging is a means of tracking events that happen when some software runs. The software's developer...
Read more >
A Step-by-Step Guide to Python Logging - Pylenin
A comprehensive guide to understanding the advantages and usage of Python Logging module.
Read more >
logging.info not showing up in console output #46 - GitHub
Not seeing logging.info() show up in the console output. In the example I don't see the "Tearing Down" or if I add logging.info...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found