We use the Django logging module for our Django app, which runs on a couple of Apache instances on a server; each instance is a different setup, like production/staging/development/testing. How do I log the Apache instance name in the logger? Currently, I've tried this, and it only logs the machine name.
try:
HOSTNAME = socket.gethostname()
except:
HOSTNAME = 'localhost'
LOGGING = {
'formatters': {
'standard': {
'format': '%(asctime)s [' + HOSTNAME + '] [%(levelname)s]:[%(lineno)s] - %(message)s'
},
}
}
How do I identify the Apache instance here?