Skip to content

Commit

Permalink
Merge dd73fed into 572dd93
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjb authored Oct 1, 2018
2 parents 572dd93 + dd73fed commit d87b143
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ app.get('/', function (req, res) {
Simple app that will log all requests in the Apache combined format to one log
file per day in the `log/` directory using the
[rotating-file-stream module](https://www.npmjs.com/package/rotating-file-stream).
The `rotating-file-stream` module will automatically create the log directory in
this example if it doesn't already exist.

```js
var express = require('express')
Expand All @@ -320,9 +322,6 @@ var rfs = require('rotating-file-stream')
var app = express()
var logDirectory = path.join(__dirname, 'log')

// ensure log directory exists
fs.existsSync(logDirectory) || fs.mkdirSync(logDirectory)

// create a rotating write stream
var accessLogStream = rfs('access.log', {
interval: '1d', // rotate daily
Expand Down

0 comments on commit d87b143

Please sign in to comment.