{"repo":"expressjs/morgan","free":true,"listed":false,"github":"https://github.com/expressjs/morgan","clone":"git clone https://github.com/expressjs/morgan.git","description":"HTTP request logger middleware for node.js","language":"JavaScript","stars":8197,"topics":["nodejs","javascript","express","logger"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"morgan [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coverage Status][coveralls-image]][coveralls-url] HTTP request logger middleware for node.js Named after Dexter, a show you should not watch until completion. Installation This is a Node.js module available through the npm registry. Installation is done using the npm install command: API morgan(format, options) Create a new morgan logger middleware function using the given format and options . The format argument may be a string of a predefined name (see below for the names), a string of a format string, or a function that will produce a log entry. The format function will be called with three arguments tokens , req , and res , where tokens is an object with all defined tokens, req is the HTTP request and res is the HTTP response. The function is expected to return a string that will be the log line, or undefined / null to skip logging. Using a predefined format string Using format string of predefined tokens Using a custom format function Options Morgan accepts these properties in the options object. immediate Write log line on request instead of response. This means that a requests will be logged even if the server crashes, but data from the response (like the response code, content length, etc.) cannot be logged . skip Function to determine if logging is skipped, defaults to false . This function will be called as skip(req, res) . stre","default_branch":null,"files":null,"tree":[],"storefront":"/r/expressjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/expressjs/morgan/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}