# serverless-logstreaming

> Serverless Logstreaming Plugin - Stream logs to the loghandler function

Latest version **1.1.3** (published 2017-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install serverless-logstreaming
pnpm add serverless-logstreaming
yarn add serverless-logstreaming
bun add serverless-logstreaming
```

## 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.1.3 |
| Published | 2017-08-28 |
| First published | 2017-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Michael Riffle |
| Maintainers | rifflock |
| Keywords | serverless plugin logstreaming, serverless framework plugin, serverless applications, serverless plugins, cloudwatch, aws cloudwatch, lambda, aws, aws lambda, amazon, amazon web services, serverless.com, logs |

## Links

- npm: https://www.npmjs.com/package/serverless-logstreaming
- Repository: https://github.com/rifflock/serverless-logstreaming-plugin
- Issues: https://github.com/rifflock/serverless-logstreaming-plugin/issues
- npm.io page: https://npm.io/package/serverless-logstreaming

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2017-08-28
- 1.1.2 — 2017-08-22
- 1.1.1 — 2017-08-21
- 1.0.0 — 2017-08-04

## README

# ⚡️ Serverless Logstreaming Plugin

[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)
[![npm](https://img.shields.io/npm/v/logstreaming.svg)](https://www.npmjs.com/package/serverless-logstreaming)
[![license](https://img.shields.io/github/license/rifflock/serverless-logstreaming-plugin.svg)](https://github.com/rifflock/serverless-logstreaming-plugin/blob/master/LICENSE)
[![dependencies](https://img.shields.io/david/rifflock/serverless-logstreaming-plugin.svg)](https://www.npmjs.com/package/serverless-logstreaming)


## About
This Serverless plugin allows for simple streaming of logs through a given function
with the popular [Serverless Framework](https://serverless.com) and AWS Lambda.

## Configuration

Currently this plugin ONLY works with the AWS provider.

1. Add `serverless-logstreaming` to your `serverless.yml` file in the root of your serverless project

```
plugins:
  - serverless-logstreaming
```

2. Define your loghandler function:

```
functions:
  myLogHandler:
    description: 'CW Logs handler for Tasks'
    handler: handlers/myLogHandler/handler.handler
```

3. Reference the name of your loghandler function in the custom section:

```
custom:
  logHandler:
    function: myLogHandler
```

And that's all it takes. Now the logs of all your lambda functions will stream through that loghandler.

If you have a function where you _don't_ want to stream logs through the loghandler it's as simple as adding an exception:

```
functions:
  handlerToNotStream:
    description: 'This lambda should not stream logs'
    loghandler: false
```

That `loghandler: false` will exempt this lambda from streaming through the loghandler function.

## Changelog
* 1.1.3 - Fix several permissions bugs. Remove unnecessary logFilter.
* 1.1.0 - Add logstreaming permission by default instead of requiring user to do so, add flexibility in naming
* 1.0.0 - Initial commit.

## Acknowledgements
* Thanks to @andymac4182 for the [gist](https://gist.github.com/andymac4182/4837f722231ea493685f6b4699c939a1) that inspired this plugin.
* Thanks to @HyperBrain and the @serverless team

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