Skip to content
atarashi
Documentation menu

obs/morgan-logger

Human-readable HTTP request logging for Express in development, combined format in production.

Provides: logging, logging:morgan

Requires: http:express, config:env

Conflicts with: logging

Dependencies

  • morgan@^1.10.1

Development only:

  • @types/morgan@^1.9.10 (when provides('language:typescript'))

What it contributes to other files

FileSlotLine
src/app.ts|jsimportsimport morgan from 'morgan';
src/app.ts|jsimportsimport { env } from './config/env.js';
src/app.ts|jsmiddlewareapp.use(morgan(env.NODE_ENV === 'production' ? 'combined' : 'dev'));

Use it

atarashi new my-app --add obs/morgan-logger
atarashi add obs/morgan-logger

Version 1.0.0. Format reference: Authoring blueprints.

Part of the atarashi documentation, written and maintained by Gautam Suthar.