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 runserver is not working for use_queue #178

Closed
hiren30598 opened this issue Oct 20, 2022 · 3 comments
Closed

Django runserver is not working for use_queue #178

hiren30598 opened this issue Oct 20, 2022 · 3 comments

Comments

@hiren30598
Copy link

hiren30598 commented Oct 20, 2022

LOGGING = {
    "version": 1,
    "disable_existing_loggers": False,
    "handlers": {
        "file": {
            "level": "INFO",
            "class": "logging.FileHandler",
            "filename": "log.log",
            "formatter": "app",
        },
        "console": {
            "level": "DEBUG",
            "class": "logging.StreamHandler",
            "formatter": "app",
        },
        'watchtower': {
            'level': 'DEBUG',
            'class': 'watchtower.CloudWatchLogHandler',
            'boto3_client': boto3_session,
            'log_group': AWS_LOG_GROUP,
            'stream_name': AWS_LOG_STREAM,
            'formatter': 'aws',
            'max_batch_count' : 10,
        },
    },
    "loggers": {
        "django": {
            "handlers": ["watchtower"], 
            "level": "INFO", 
            "propagate": True
        },
    },
    "formatters": {
        "app": {
            "format": (
                "%(asctime)s [%(levelname)-8s] %(lineno)s"
                "(%(module)s.%(funcName)s) %(message)s"
            ),
            "datefmt": "%Y-%m-%d %H:%M:%S",
        },
        'aws': {
            "format": (
                "%(asctime)s [%(levelname)-8s] %(lineno)s"
                "(%(module)s.%(funcName)s) %(message)s"
            ),
            "datefmt": "%Y-%m-%d %H:%M:%S",
        },
    },
}

I have used these settings for the logger but the Django server is not working and nothing is logged on the console. when I use the use_queue=False then it works but it affects the performance.

can you check and let me know what is the issue? I am using the latest version.

@glynjackson
Copy link

I'm experiencing the same issue. Did you get a solution?

@hiren30598
Copy link
Author

Yes by changing the log name it works.
Default we are taking django, so change with other custom logger name it will work

@hiren30598
Copy link
Author

Works after changing the logger name from default django

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

2 participants