Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14568

django.server logs are not shown in CloudWatch - Using Zappa

$
0
0

My django application is running on AWS Lambda with zappa. I recently added the following to configure logs.

LOGGING = {"version": 1,"disable_existing_loggers": False,"filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse",        },"require_debug_true": {"()": "django.utils.log.RequireDebugTrue",        },"filter_user_id": {"()": "<path_to>.UserIdFilter"},    },"formatters": {"django.server": {"format": "[%(asctime)s] %(message)s user_id:%(user_id)s ",        }    },"handlers": {"console": {"level": "INFO","filters": ["require_debug_true"],"class": "logging.StreamHandler",        },"django.server": {"level": "INFO","class": "logging.StreamHandler","formatter": "django.server",        },    },"loggers": {"django": {"handlers": ["console"],"level": "INFO",        },"django.server": {"handlers": ["django.server"],"filters": ["filter_user_id"],"level": "INFO","propagate": False,        },    },}

This is working well when I run this on docker / local server. But when I deployed this to AWS Lambda it is not showing the corresponding logs in the Cloudwatch.

Could anyone help? Thanks in advance.


Viewing all articles
Browse latest Browse all 14568

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>