Skip to content
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

Django and LogDNA, server seems to be getting stuck #55

Open
Montana opened this issue Dec 28, 2021 · 0 comments
Open

Django and LogDNA, server seems to be getting stuck #55

Montana opened this issue Dec 28, 2021 · 0 comments

Comments

@Montana
Copy link

Montana commented Dec 28, 2021

Hey LogDNA,

It could be my configuration but when trying to use LogDNA and Django, the server seems to get stuck. Here's some cursory information:

import logging
from logdna import LogDNAHandler

    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'verbose': {
                'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s]" +
                        "%(message)s",
                'datefmt': "%d/%b/%Y %H:%M:%S"
            },
            'color': {
                '()': 'colorlog.ColoredFormatter',
                'format': '%(log_color)s%(asctime)s %(levelname)-8s %(name)s %(module)s  %(pathname)s:%(lineno)s%(reset)s \n\r\t %(message)s',
                'datefmt': "%d/%b/%Y %H:%M:%S",
                'log_colors': {
                    'DEBUG': 'cyan',
                    'INFO': 'green',
                    'WARNING': 'yellow',
                    'ERROR': 'red',
                    'CRITICAL': 'red,bg_white',
                }
            }
        },
        'filters': {
            'require_debug_true': {
                '()': 'django.utils.log.RequireDebugTrue',
            },
        },


        'handlers': {
            'console': {
                'level': 'DEBUG',
                'filters': ['require_debug_true'],
                'class': 'logging.StreamHandler',
                'formatter': 'color'
            },
            'logdna': {
                'level': logging.DEBUG,
                'class': 'logdna.LogDNAHandler',
                'key': "my_secret_key",
                'options': {
                    # 'app': '<app name>',
                    # 'env': "alpha",
                    'index_meta': True,
                },
            },
        },


        'loggers': {
            '': {
                'level': logging.DEBUG,
                'handlers': ['logdna'],
                'propagate': True,
            },
        }
    }

I am using the above example for Django logging using LogDNA. But when I'm running a Django server, it's getting stuck. For reference I'm using this as a guide.

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

No branches or pull requests

1 participant