File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,8 +64,9 @@ import next from './next.js'
6464import renderPage from './render-page.js'
6565import assetPreprocessing from './asset-preprocessing.js'
6666
67- const { NODE_ENV } = process . env
67+ const { DEPLOYMENT_ENV , NODE_ENV } = process . env
6868const isDevelopment = NODE_ENV === 'development'
69+ const isAzureDeployment = DEPLOYMENT_ENV === 'azure'
6970const isTest = NODE_ENV === 'test' || process . env . GITHUB_ACTIONS === 'true'
7071
7172// Catch unhandled promise rejections and passing them to Express's error handler
@@ -79,8 +80,14 @@ export default function (app) {
7980 if ( ! isTest ) app . use ( timeout )
8081 app . use ( abort )
8182
82- // *** Development tools ***
83- app . use ( morgan ( 'dev' , { skip : ( req , res ) => ! isDevelopment } ) )
83+ // *** Request logging ***
84+ // Enabled in development and azure deployed environments
85+ // Not enabled in Heroku because the Heroku router + papertrail already logs the request information
86+ app . use (
87+ morgan ( isAzureDeployment ? 'combined' : 'dev' , {
88+ skip : ( req , res ) => ! ( isDevelopment || isAzureDeployment ) ,
89+ } )
90+ )
8491
8592 // *** Observability ***
8693 if ( process . env . DD_API_KEY ) {
You can’t perform that action at this time.
0 commit comments