# the-simple-log

> A simple logging utility for NodeJS

Latest version **1.1.21** (published 2019-05-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install the-simple-log
pnpm add the-simple-log
yarn add the-simple-log
bun add the-simple-log
```

## 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.21 |
| Published | 2019-05-22 |
| First published | 2019-05-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jlewitt |
| Keywords | logging, debugging, console |

## Links

- npm: https://www.npmjs.com/package/the-simple-log
- Repository: https://github.com/jlewitt/the-simple-log
- Homepage: https://app.thesimplelog.com/
- Issues: https://github.com/jlewitt/the-simple-log/issues
- npm.io page: https://npm.io/package/the-simple-log

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.3.0

## 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

- 1.1.21 (latest) — 2019-05-22
- 1.1.20 — 2019-05-17
- 1.1.9 — 2019-05-16
- 1.1.8 — 2019-05-16
- 1.1.7 — 2019-05-16
- 1.1.6 — 2019-05-14
- 1.1.5 — 2019-05-13
- 1.1.4 — 2019-05-13
- 1.1.3 — 2019-05-13
- 1.1.2 — 2019-05-12
- 1.1.1 — 2019-05-12

## README

# simple-log: a cloud-based log for node

simple-log is the simple way to do logging on node. Debug your application from anywhere, whether it's running locally, in a docker container, or in a VPS in the cloud.

## Table of Contents

- [Installation](#installation)
- [Requirements](#requirements)
- [Usage](#usage)
- [Examples](#examples)
	- [Logging 101](#logging-101)
- [Configuration Options](#options)
- [Transports](#transports)
- [Output Formats](#output-formats)


## Installation

```
npm install -S simple-log
```

## Requirements
You need to create an API Key and a Project on [https://app.thesimplelog.com/](https://app.thesimplelog.com/signup)

## Usage
After setting up the simple object:
```
const options = { apiKey: 'your.api.key.here', projectName: 'My App' };
const simple = require('simple-log')(options);
```
You can call `simple.log` or one of the convenience functions (`simple.debug`, `simple.info`, `simple.warn`, `simple.error`, `simple.fatal`)

## Examples

### Logging 101
```
'use strict';

const options = { apiKey: 'your.api.key.here', project: 'My App' };
const simple = require('simple-log')(options);

// since we're using simple.log, we have to pass the logging level ('info') ourselves
simple.log('info', 'Started application'); 

// helper functions perform the same action as simple.log('LEVEL', 'message')
simple.info('Initializing modules...');
simple.debug('Starting MySQL');
simple.debug('Starting Redis');

```
## Options
There are a number of options that can be set while initializing the simple object:
* `apiKey` (required) - obtain via https://app.thesimplelog.com/
* `project` (required) - obtain via https://app.thesimplelog.com/
* `transports` (optional) - default value: `["simple-api", "console"]`, allowable values: `["simple-api", "console"]`
* `consoleFormat` (optional) - default value: `d h (i): m`, allowable values can be seen [here](#output-formats)

## Transports
There are two available transports, both are enabled by default: 
* `simple-api` - logs to The Simple App API
* `console` - logs locally to `stdout`, just like `console.log`

## Output Formats
When logging to the console (using the `console` transport option and setting `consoleFormat`), you can specify the preferred format from the following options:

* `f: filename`
* `l: line number`
* `h: hostname`
* `i: internal ip`
* `e: external ip`
* `d: date`
* `m: message`

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