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
None of the mentioned solutions worked for me as I am running my server on Amazon Linux 2
.
The problem wasn't in the logging configuration itself but in the .log
file permissions.
This is my related logger.config
file in .ebextensions:
commands:
01_create_log_file:
command: 'touch /var/log/django.log'
02_change_log_file_permissions:
command: 'sudo chmod ugo+rwx /var/log/django.log'
As you can see I had to handle the permission problem by simply giving all permissions to all users.
This is my Django logger configuration:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/var/log/django.log',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}