log.format, error reporting

This commit is contained in:
Lloyd Brookes
2016-07-01 20:53:10 +01:00
parent 3d521399f6
commit 3e54a492f7
6 changed files with 32 additions and 17 deletions

View File

@ -54,7 +54,7 @@ $ ws --help
Server
-p, --port <number> Web server port
-f, --log-format <string> If a format is supplied an access log is written to stdout. If not, a statistics view is displayed. Use a
-f, --log.format <string> If a format is supplied an access log is written to stdout. If not, a statistics view is displayed. Use a
preset ('none', 'dev','combined', 'short', 'tiny' or 'logstalgia') or supply a custom format (e.g. ':method ->
:url').
-d, --directory <string> Root directory, defaults to the current directory
@ -90,11 +90,11 @@ $ ws --compress
```
### Logging
Passing a value to `--log-format` will write an access log to `stdout`.
Passing a value to `--log.format` will write an access log to `stdout`.
Either use a built-in [morgan](https://github.com/expressjs/morgan) logger preset:
```sh
$ ws --log-format short
$ ws --log.format short
```
Or a custom [morgan](https://github.com/expressjs/morgan) log format:
@ -123,7 +123,7 @@ Or in a `.local-web-server.json` file stored in the directory you want to serve
```json
{
"port": 8100,
"log-format": "tiny"
"log.format": "tiny"
}
```