# @deadlock-delegate/logger-pino-stackdriver

> Ark Ecosystem plugin enabling sending logs to Stackdriver

Latest version **0.1.0** (published 2019-08-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @deadlock-delegate/logger-pino-stackdriver
pnpm add @deadlock-delegate/logger-pino-stackdriver
yarn add @deadlock-delegate/logger-pino-stackdriver
bun add @deadlock-delegate/logger-pino-stackdriver
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-08-03 |
| First published | 2019-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | roks0n |
| Maintainers | rokson |
| Keywords | blockchain, ark, ark ecosystem, plugin, crypto, dpos, logging, stackdriver |

## Links

- npm: https://www.npmjs.com/package/@deadlock-delegate/logger-pino-stackdriver
- Repository: https://github.com/deadlock-delegate/logger-pino-stackdriver
- Issues: https://github.com/deadlock-delegate/logger-pino-stackdriver/issues
- npm.io page: https://npm.io/package/@deadlock-delegate/logger-pino-stackdriver

## Dependencies (5)

- [pino-stackdriver](https://npm.io/package/pino-stackdriver.md) ^1.2.6
- [@arkecosystem/core-logger](https://npm.io/package/@arkecosystem/core-logger.md) ^2.5.14
- [@arkecosystem/core-container](https://npm.io/package/@arkecosystem/core-container.md) ^2.5.14
- [@arkecosystem/core-interfaces](https://npm.io/package/@arkecosystem/core-interfaces.md) ^2.5.14
- [@arkecosystem/core-logger-pino](https://npm.io/package/@arkecosystem/core-logger-pino.md) ^2.5.14

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-08-03

## README

# Ark Pino Stackdrive Logger  Plugin

This Ark plugin utilizes and extends Ark's core logger plugin called `core-logger-pino` and adds support for sending logs to [Google's Stackdriver](https://cloud.google.com/stackdriver/) which amongst other things also supports:

- simple searching and browsing through logs
- creating metrics from logs
- creating alerts

By replacing `core-pino-logger` with this plugin you won't loose any of existing logging functionalities. This plugins simply extends the `core-pino-pluggin` with Stackdriver. Please note that if you have custom settings set for `core-pino-logger` in `plugins.js`, you'll have to move them to `logger-pino-stackdriver` which will pass them on to the `core-pino-logger`.

## Installation

#### For production:

`yarn add global @deadlock-delegate/logger-pino-stackdriver`

#### For development:

```bash
cd ~/ark-core/plugins
git clone https://github.com/deadlock-delegate/logger-pino-stackdriver
lerna bootstrap
```

### Registration

Open `~/.config/ark-core/{mainnet|devnet|testnet}/plugins.js` and replace `"@arkecosystem/core-logger-pino": {},` with `'@deadlock/logger-pino-stackdriver": {},`.

like so:

```js
module.exports = {
  "@arkecosystem/core-event-emitter": {},
  "@deadlock-delegate/logger-pino-stackdriver": {
    levels: {
      console: process.env.CORE_LOG_LEVEL || 'debug',  // log level of console logger (this is default that's taken from core-logger-pino)
      file: process.env.CORE_LOG_LEVEL_FILE || 'trace'  // log level of file logger (this is default that's taken from core-logger-pino)
    },
    fileRotator: {
      interval: '1d'  // how often should log file rotate (this is default that's taken from core-logger-pino)
    },
    stackdriver: {
      projectId: 'your-project-name-on-google-cloud',  // name of the project in Google Cloud where you'll be sending the logs
      logName: 'name-of-your-log'  // name of the log in Google cloud (if it doesn't exist yet, it will be created automatically)
    }
  },
  ...
}
```

### Configuration

Open .env file that is located at `~/.config/ark-core/<network>/.env` (should be replaced by either mainnet, devnet or testnet) and add the following environment variable:

```
GOOGLE_APPLICATION_CREDENTIALS=<path to your Google service account credentials>
```

for example:

```
GOOGLE_APPLICATION_CREDENTIALS=~/credentials.json
```

If you don't know how to create a Google service account for your project [check this out](https://cloud.google.com/docs/authentication/production).

##### Tips:

If you wish to send log data from multiple nodes to the same project's Stackdriver you can differentiate the logs by changing the `logName` settings on every node, eg:

node-1 should have logName set to node-1, node-2 should have logName set to node-2, etc.

## Credits

- [roks0n](https://github.com/roks0n)
- [All Contributors](../../contributors)

## License

[MIT](LICENSE) © roks0n

---
_Source: https://npm.io/package/@deadlock-delegate/logger-pino-stackdriver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
