# rokot-log

> Rocketmakers Rokot Platform - Logger

Latest version **0.3.2** (published 2017-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install rokot-log
pnpm add rokot-log
yarn add rokot-log
bun add rokot-log
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2017-09-26 |
| First published | 2016-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | developers@rocketmakers.com |
| Maintainers | rocketmakers |
| Keywords | typescript, bunyan, logger |

## Links

- npm: https://www.npmjs.com/package/rokot-log
- Repository: https://git@gitlab.com:rocketmakers/rokot/log
- Homepage: https://gitlab.com/rocketmakers/rokot/log
- Issues: https://gitlab.com/rocketmakers/rokot/log/issues
- npm.io page: https://npm.io/package/rokot-log

## Dependencies (3)

- [bunyan](https://npm.io/package/bunyan.md) ^1.8.12
- [bunyan-prettystream](https://npm.io/package/bunyan-prettystream.md) ^0.1.3
- [bunyan-logstash-amqp](https://npm.io/package/bunyan-logstash-amqp.md) 1.0.5

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.3.2 (latest) — 2017-09-26
- 0.3.4 — 2017-07-19
- 0.3.3 — 2017-07-14
- 0.3.1 — 2017-04-01
- 0.3.0 — 2017-03-01
- 0.2.5 — 2016-09-25
- 0.2.2 — 2016-09-25
- 0.2.1 — 2016-09-25
- 0.2.0 — 2016-09-25
- 0.1.6 — 2016-07-19
- 0.1.5 — 2016-07-19
- 0.1.4 — 2016-05-12
- 0.1.3 — 2016-05-12
- 0.1.2 — 2016-04-25
- 0.1.1 — 2016-04-21
- … 1 more at https://npm.io/package/rokot-log/versions

## README

# rokot-log

Rokot - [Rocketmakers](http://www.rocketmakers.com/) TypeScript NodeJs Platform

## Introduction

A typescript library for Logging.

This library extends the `bunyan` npm with factories to create Logger instances:

1. ConsoleLogger - create a Console logger
2. LogstashAmqpLogger - create a Logstash feed via Amqp

## Getting Started

### Installation
Install via `yarn`
```
yarn add rokot-log
```

## Example: Logstash Amqp

```typescript
import {LogstashAmqpLogger,Logger,ILogstashAmqpLoggerSettings} from "rokot-log";

const settings: ILogstashAmqpLoggerSettings = {
  level: "info", // Optional: default 'info' ('trace'|'info'|'debug'|'warn'|'error'|'fatal')
  host: "localhost",
  port: 5672,
  exchange:"logs" // Optional: default 'logs'
}

//Optional additional Console Logger
const consoleSettings: IConsoleLoggerSettings = {
  level: "trace",
  mode: "short"
}

const logger: Logger = LogstashAmqpLogger.create("<app name>", settings, consoleSettings);


// Register 'logger' with IoC
```

## Example: Console

```typescript
import {ConsoleLogger,Logger,IConsoleLoggerSettings} from "rokot-log";

const settings: IConsoleLoggerSettings = {
  level: "info", // Optional: default 'info' ('trace'|'info'|'debug'|'warn'|'error'|'fatal')
  mode: "short" // Optional: default 'short' ('short'|'long'|'dev'|'raw')
}

const logger: Logger = ConsoleLogger.create("<app name>", settings);

// or create a logger with default values (in 'short' mode and at 'info' level)
const defaultLogger: Logger = ConsoleLogger.create("<app name>");

// Register 'logger' with IoC
```



## Consumed Libraries

### [bunyan](https://github.com/trentm/node-bunyan)
Bunyan Logger


## Contributing

### Getting started

Install `node_modules` via `npm`
```
npm i
```

Install `typings`
```
typings install
```

Build the project (using typescript compiler)
```
npm run build
```

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