Django integration
It is possible to completely integrate this wonderful package with django?
I'm using this, but I've to change the fmt because the hostname for example doesn't get injected.
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"coloredlogs": {
"()": "coloredlogs.ColoredFormatter",
"fmt": "[%(asctime)s] %(name)s %(levelname)s %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": LOGGING_LEVEL,
"formatter": "coloredlogs",
},
},
"loggers": {
"": {
"handlers": [
"console",
],
"level": LOGGING_LEVEL,
},
},
}
I was able to add the hostname filter, but yet I don't know how to integrate the verboselogs package
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"coloredlogs": {
"()": "coloredlogs.ColoredFormatter",
"fmt": "[%(asctime)s] %(hostname)s %(name)s %(levelname)s %(message)s",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": LOGGING_LEVEL,
"formatter": "coloredlogs",
"filters": [
"hostname",
],
},
},
"filters": {
"hostname": {
"()": "coloredlogs.HostNameFilter",
},
},
"loggers": {
"": {
"handlers": [
"console",
],
"level": LOGGING_LEVEL,
},
"botocore": {
"handlers": ["console"],
"level": "WARNING",
},
"boto3": {
"handlers": ["console"],
"level": "WARNING",
},
},
}
@jjlorenzo were you able to solve this eventually? would be great if you shared your solution. I still can't seem to get the hostname filter working.
Unfortunately I change this and I'm not using anymore, but for what I remember, my previous message include my working solution for django logging config using the hostname filter.
@jjlorenzo thanks, got it working... a mishap on my end. that solution still works.