Add LOG_IDS env variable

This commit is contained in:
MICHAEL JACKSON 2017-05-24 21:38:06 -07:00
parent 751b702a55
commit 68b6b94e54
1 changed files with 4 additions and 1 deletions

View File

@ -54,9 +54,12 @@ const createServer = (config) => {
app.disable('x-powered-by')
if (process.env.NODE_ENV === 'development')
if (process.env.NODE_ENV !== 'production')
app.use(morgan('dev'))
if (process.env.LOG_IDS)
app.use(morgan('[:date[clf]] :method :url req-id=:req[x-request-id] cf-ray=:req[cf-ray]'))
app.use(errorHandler)
app.use(cors())