# koa-log-req-on-err

> When an error occurs, log request details.

Latest version **1.2.0** (published 2017-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-log-req-on-err
pnpm add koa-log-req-on-err
yarn add koa-log-req-on-err
bun add koa-log-req-on-err
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-05-16 |
| First published | 2016-08-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | nwyfiant |
| Keywords | http, errors |

## Links

- npm: https://www.npmjs.com/package/koa-log-req-on-err
- Repository: https://github.com/dtdd2l/koa-log-req-on-err
- Homepage: https://github.com/dtdd2l/koa-log-req-on-err#readme
- Issues: https://github.com/dtdd2l/koa-log-req-on-err/issues
- npm.io page: https://npm.io/package/koa-log-req-on-err

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.2.0 (latest) — 2017-05-16
- 1.1.0 — 2017-03-15
- 1.0.1 — 2016-11-21
- 1.0.0 — 2016-08-08

## README

# koa-log-req-on-err

Log request details upon error.  This includes X-Platform header, Authorization header, method, path, query, and body.

400 level errors are logged at the info level, while 500 level errors are logged at the error level.

## usage

```javascript
var logReqOnErr = require('koa-log-req-on-err');

app.use(error()); // koa-error
app.use(logReqOnErr())); // when an error occurs, logs request details
app.use(function* () {
  // do something with koa
});
```

---
_Source: https://npm.io/package/koa-log-req-on-err · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
