npm/npm — pull request #5252 by timoxley (2014-05-11 14:48:32+00:00)
Title: Make npm-debug.log path configurable.

If this is acceptable, I'll send the appropriate PRs for the `npm-log` config in npmconf and add docs.

Allows for location of `npm-debug.log` to be specified:

```
> npm install asdasdas --log-file=/var/log/npm/myapp.log
npm WARN package.json npm-debug-log-test@1.2.3 No description
npm WARN package.json npm-debug-log-test@1.2.3 No repository field.
npm WARN package.json npm-debug-log-test@1.2.3 No README data
npm ERR! 404 404 Not Found: asdasdas
npm ERR! 404
npm ERR! 404 'asdasdas' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'npm-debug-log-test'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/Users/timoxley/Projects/libs/npm/bin/npm-cli.js" "install" "asdasdas" "--log-file=/var/log/npm/myapp.log"
npm ERR! cwd /Users/timoxley/Projects/libs/npm/test/tap/npm-debug-log
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.4.10
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/log/npm/myapp.log
npm ERR! not ok code 0
> ls /var/log/npm
myapp.log
```

Perhaps might want to throw in a mkdirp on the log directory, and perhaps an alias/rename to `logfile` vs `log-file`, and I guess also needs a fallback, if it can't write to log, just write to default cwd/npm-debug.log.

Related https://github.com/npm/npm/issues/1548