How do you manage your application logs in AWS elastic beanstalk? Which file you write you application logs to?
I\'m using the following Logging configuration in my d
As a beginner in terms of linux permissions, it took me some time to get it to work. Summarising the above given answers the following finally worked for me:
logging.config
commands:
00_create_dir:
command: mkdir -p /var/log/app-logs
01_change_permissions:
command: chmod g+s /var/log/app-logs
02_change_default_owner:
command: setfacl -d -m g::rw /var/log/app-logs
03_change_owner:
command: chown wsgi:wsgi /var/log/app-logs
settings.py
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/var/log/app-logs/django.log',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
With this I can see the logs as a separate section using 'eb logs' or within the Beanstalk environment, section "logs".