<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-use-morgan-in-your-node-js-project--8gjmu-ffh" -->

---
title: How to Use Morgan in Your Node.js Project. | daily.dev
description: Morgan is a logging tool (middleware) that can be used in HTTP servers implemented using Express & Node.js. To use morgan in your Express server, you can...
canonical: https://daily.dev/posts/how-to-use-morgan-in-your-node-js-project--8gjmu-ffh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Use Morgan in Your Node.js Project. | daily.dev
og:description: Morgan is a logging tool (middleware) that can be used in HTTP servers implemented using Express & Node.js. To use morgan in your Express server, you can...
og:url: https://daily.dev/posts/how-to-use-morgan-in-your-node-js-project--8gjmu-ffh
og:image: https://api.daily.dev/og/posts/8GJmu_Ffh.png
og:image:alt: How to Use Morgan in Your Node.js Project.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Use Morgan in Your Node.js Project.

**[gitconnected](https://daily.dev/sources/gc)** · 3 min read · 22 upvotes · 2 comments

## Summary

Morgan is a logging tool (middleware) that can be used in HTTP servers implemented using Express & Node.js. To use morgan in your Express server, you can invoke an instance and pass it as an argument in the .use() middleware before your HTTP requests. Morgan comes with a suite of presets, or predefined format strings, to create a new logger middleware with built-in format and options.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://levelup.gitconnected.com/how-to-use-morgan-in-your-nodejs-project-3d1a82de81ac?source=rss----5517fd7b58a6---4>

## Community discussion

Top comments from developers on daily.dev.

**@eomm** · 2 upvotes

> morgan latest release 2 years ago.
> Express latest major 8 years ago.
>
> Try fastify (web framework) + pino (logger)

---

Tags: [#nodejs](https://daily.dev/tags/nodejs)

[View this post on daily.dev](https://daily.dev/posts/how-to-use-morgan-in-your-node-js-project--8gjmu-ffh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Use Morgan in Your Node.js Project.","url":"https://daily.dev/posts/how-to-use-morgan-in-your-node-js-project--8gjmu-ffh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-morgan-in-your-node-js-project--8gjmu-ffh"},"datePublished":"2022-07-17T21:05:37.730Z","dateModified":"2022-07-17T21:05:37.729Z","description":"Morgan is a logging tool (middleware) that can be used in HTTP servers implemented using Express \u0026 Node.js. To use morgan in your Express server, you can...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/dc259ac5f4cdc6061ceb03d0cab3b96c","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/dc259ac5f4cdc6061ceb03d0cab3b96c","isAccessibleForFree":true,"articleSection":"gitconnected","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"gitconnected","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/gc","url":"https://daily.dev/sources/gc"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/how-to-use-morgan-in-your-node-js-project--8gjmu-ffh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":22},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"nodejs","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"gitconnected","item":"https://daily.dev/sources/gc"},{"@type":"ListItem","position":3,"name":"How to Use Morgan in Your Node.js Project."}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-morgan-in-your-node-js-project--8gjmu-ffh","comment":[{"@type":"Comment","text":"morgan latest release 2 years ago.\nExpress latest major 8 years ago.\nTry fastify (web framework) + pino (logger)","datePublished":"2022-07-19T15:49:59.795Z","url":"https://daily.dev/posts/8GJmu_Ffh#c-KMLPGtUFh","author":{"@type":"Person","name":"Manuel Spigolon","url":"https://daily.dev/eomm","image":"https://lh3.googleusercontent.com/a-/AOh14Giba6GKr61vvfcpL2sUSq0MkxWu6ZNCAxp0KQZ2wWw=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
```

