open-index/open-npm huggingface dataset:
npm package: @log4brains/cli
Description: Log4brains architecture knowledge base CLI
Author: Thomas Vaillant
Latest version: 1.1.0

# @log4brains/cli

This package provides the CLI features of the [Log4brains](https://github.com/thomvaill/log4brains) architecture knowledge base.
It is not meant to be used directly.

Install [the main log4brains package](https://www.npmjs.com/package/log4brains) instead:

```bash
npm install -g log4brains
```

## Documentation

- [Log4brains README](https://github.com/thomvaill/log4brains/blob/develop/README.md)
npm package: @log4brains/cli-common
Description: Log4brains architecture knowledge base common CLI features
Author: Thomas Vaillant
Latest version: 1.1.0

# @log4brains/cli-common

This package provides common features for all [Log4brains](https://github.com/thomvaill/log4brains) CLI-based packages.
It is not meant to be used directly.

Install [the main log4brains package](https://www.npmjs.com/package/log4brains) instead:

```bash
npm install -g log4brains
```

## Documentation

- [Log4brains README](https://github.com/thomvaill/log4brains/blob/develop/README.md)

## Development

```bash
yarn dev:test
```
npm package: @log4brains/core
Description: Log4brains architecture knowledge base core API
Author: Thomas Vaillant
Latest version: 1.1.0

# @log4brains/core

This package provides the core API of the [Log4brains](https://github.com/thomvaill/log4brains) architecture knowledge base.
It is not meant to be used directly.

Install [the main log4brains package](https://www.npmjs.com/package/log4brains) instead:

```bash
npm install -g log4brains
```

## Installation

This package is not meant to be installed directly in your project.

However, if you want to create a package that uses [Log4brains](https://github.com/thomvaill/log4brains)' API,
you can include this package as a dependency:

```bash
npm install --save @log4brains/core
```

or

```bash
yarn add @log4brains/core
```

## Usage

```typescript
import { Log4brains } from "@log4brains/core";

const l4b = Log4brains.createFromCwd(process.cwd());

// See the TypeDoc documentation (TODO: to deploy on GitHub pages) to see available API methods
```

## Documentation

- TypeDoc documentation (TODO)
- [Log4brains README](https://github.com/thomvaill/log4brains/blob/develop/README.md)
npm package: @log4brains/init
Description: Log4brains architecture knowledge base initialization CLI
Author: Thomas Vaillant
Latest version: 1.1.0

# @log4brains/init

This package provides the initialization script of the [Log4brains](https://github.com/thomvaill/log4brains) architecture knowledge base.
It is not meant to be used directly.

Install [the main log4brains package](https://www.npmjs.com/package/log4brains) instead:

```bash
npm install -g log4brains
```

## Documentation

- [Log4brains README](https://github.com/thomvaill/log4brains/blob/develop/README.md)
npm package: @log4brains/web
Description: Log4brains architecture knowledge base web UI and static site generator
Author: Thomas Vaillant
Latest version: 1.1.0

# @log4brains/web

This package provides the static site generation features of the [Log4brains](https://github.com/thomvaill/log4brains) architecture knowledge base.
It is not meant to be used directly.

Install [the main log4brains package](https://www.npmjs.com/package/log4brains) instead:

```bash
npm install -g log4brains
```

## Documentation

- [Log4brains README](https://github.com/thomvaill/log4brains/blob/develop/README.md)
npm package: @log4js-node/gelf
Description: GELF Appender for log4js-node
Author: Gareth Jones
Latest version: 1.0.2

# Log4JS - GELF appender

This is an optional appender for [log4js-node](https://log4js-node.github.io/log4js-node/).
```bash
npm install @log4js-node/gelf
```

The GELF appender supports sending log messages over UDP to a [GELF](http://docs.graylog.org/en/2.2/pages/gelf.html) compatible server such as [Graylog](https://www.graylog.org). It uses node's core UDP support and does not require any other dependencies. If you use this appender, remember to call `log4js.shutdown` when your application terminates, so that all messages will have been sent to the server and the UDP socket can be closed. The appender supports passing custom fields to the server in both the config, and in individual log messages (see examples below).

## Configuration

* `type` - `@log4js-node/gelf`
* `host` - `string` (defaults to `localhost`) - the gelf server hostname
* `port` - `integer` (defaults to `12201`) - the port the gelf server is listening on
* `hostname` - `string` (defaults to `OS.hostname()`) - the hostname used to identify the origin of the log messages.
* `facility` - `string` (optional)
* `customFields` - `object` (optional) - fields to be added to each log message; custom fields must start with an underscore.

## Example (default config)
```javascript
log4js.configure({
  appenders: {
    gelf: { type: '@log4js-node/gelf' }
  },
  categories: {
    default: { appenders: ['gelf'], level: 'info' }
  }
});
```
This will send log messages to a server at `localhost:12201`.

## Example (custom fields in config)
```javascript
log4js.configure({
  appenders: {
    gelf: { type: '@log4js-node/gelf', host: 'gelf.server', customFields: { '_something': 'yep' } }
  },
  categories: {
    default: { appenders: ['gelf'], level: 'info' }
  }
});
```
This will result in all log messages having the custom field `_something` set to 'yep'.

# Example (custom fields in log message)
```javascript
log4js.configure({
  appenders: {
    gelf: { type: '@log4js-node/gelf', customFields: { '_thing': 'isathing' } }
  },
  categories: {
    default: { appenders: ['gelf'], level: 'info' }
  }
});
const logger = log4js.getLogger();
logger.error({ GELF: true, _thing2: 'alsoathing' }, 'oh no, something went wrong');
```
This will result in a log message with the custom fields `_thing` and `_thing2`. Note that log message custom fields will override config custom fields.
npm package: @log4js-node/hipchat
Description: Hipchat Appender for log4js-node
Author: Gareth Jones
Latest version: 1.0.0

# Hipchat Appender for Log4JS

This is an optional appender for [log4js](https://log4js-node.github.io/log4js-node/).
```bash
npm install @log4js-node/hipchat
```

The hipchat appender will send every log message it receives to a [hipchat](http://www.hipchat.com) server, over HTTP. It uses the [hipchat-notifier](https://www.npmjs.com/package/hipchat-notifier) library. If you're not sure what some of the configuration options below mean, then check the documentation for hipchat-notifier, and the hipchat docs themselves.

## Configuration

* `type` - `hipchat`
* `hipchat_token` - `string` - User token with notification privileges
* `hipchat_room` - `string` - Room ID or name
* `hipchat_from` - `string` (optional, defaults to empty string) - a label to say where the message is from
* `hipchat_notify` - `boolean` (optional, defaults to `false`) - make hipchat annoy people
* `hipchat_host` - `string` (optional, defaults to `api.hipchat.com`) - set this if you have your own hipchat server
* `hipchat_response_callback` - `function` (optional, defaults to only throwing errors) - implement this function if you want intercept the responses from hipchat
* `layout` - (optional, defaults to `messagePassThroughLayout`)  - see [layouts](https://log4js-node.github.io/log4js-node/layouts.html)

## Example (default config)

```javascript
log4js.configure({
  appenders: {
    squawk: { type: 'hipchat', hipchat_token: 'abc123', hipchat_room: 'ops' }
  },
  categories: {
    default: { appenders: ['squawk'], level: 'error'}
  }
});
```
This will result in all error (and above) messages being sent to the hipchat room "ops".

# Example (use all the options!)

```javascript
log4js.configure({
  appenders: {
    squawk: {
      type: 'hipchat',
      hipchat_token: 'abc123',
      hipchat_room: 'things_are_on_fire',
      hipchat_from: 'Hal9000',
      hipchat_notify: true,
      hipchat_host: 'hipchat.yourorganisation.com',
      hipchat_response_callback: function(err, response) {
        console.log("I got a response from hipchat: ", response);
      }
    }
  },
  categories: {
    default: { appenders: ['squawk'], level: 'info' }
  }
});
```
npm package: @log4js-node/log4js-api
Description: For libraries that want to include log4js for logging, but don't want to introduce version conflicts for users that also use log4js. Delegates to whatever log4js version can be found, but does not introduce a specific log4js version.
Author: Gareth Jones
Latest version: 1.0.2

# Log4js - API

This library is intended for use by other library makers that want to include support for [log4js](https://github.com/nomiddlename/log4js-node) in their libraries without requiring a dependency on a specific version of log4js. It is intended that this library should remain static, and will work with any version of log4js. If no version of log4js can be found, then the library simply does not output anything.

## Installation

```
npm install @log4js-node/log4js-api
```

## Usage

Use as you would log4js - only without configuring it, it would be your library's clients that are responsible for configuring log4js (if they want to). The API is limited to only `getLogger` on the log4js object, and returns a Logger object that only supports the basic log functions (trace, debug, info, warn, error, fatal). If log4js is found in the require path, then the real log4js Logger object is returned.

```javascript
const log4js = require('@log4js-node/log4js-api');
const logger = log4js.getLogger('my-library');

logger.info("Library starting up");
```
npm package: @log4js-node/logfaces-http
Description: LogFaces HTTP Appender for log4js-node
Author: Gareth Jones
Latest version: 1.0.0

# logFaces Appender (HTTP) for log4js-node

The logFaces appenders send JSON formatted log events to [logFaces](http://www.moonlit-software.com) receivers. This appender uses HTTP to send the events (there is another logFaces appender that uses [UDP](https://github.com/log4js-node/logFaces-UDP)).

```bash
npm install log4js @log4js-node/logfaces-http
```

## Configuration

* `type` - `@log4js-node/logfaces-http`
* `url` - `string` - logFaces receiver servlet URL
* `application` - `string` (optional, defaults to empty string) - used to identify your application's logs
* `timeout` - `integer` (optional, defaults to 5000ms) - the timeout for the HTTP request.

This appender will also pick up Logger context values from the events, and add them as `p_` values in the logFaces event. See the example below for more details.

# Example (default config)

```javascript
log4js.configure({
  appenders: {
    logfaces: { type: 'logFaces-HTTP', url: 'http://lfs-server/logs' }
  },
  categories: {
    default: { appenders: [ 'logfaces' ], level: 'info' }
  }
});

const logger = log4js.getLogger();
logger.addContext('requestId', '123');
logger.info('some interesting log message');
logger.error('something has gone wrong');
```
This example will result in two log events being sent to `lfs-server`. Both events will have a `p_requestId` property with a value of `123`.
npm package: @log4js-node/logfaces-udp
Description: LogFaces UDP Appender for log4js-node
Author: Gareth Jones
Latest version: 1.0.0

# logFaces Appender (UDP) for log4js-node

The logFaces appenders send JSON formatted log events to [logFaces](http://www.moonlit-software.com) receivers. This appender uses UDP to send the events (there is another logFaces appender that uses [HTTP](https://github.com/log4js-node/logFaces-HTTP/)). It uses the node.js core UDP support, so you do not need to include any other dependencies.

```bash
npm install log4js @log4js-node/logfaces-udp
```

## Configuration

* `type` - `@log4js-node/logfaces-udp`
* `remoteHost` - `string` (optional, defaults to '127.0.0.1')- hostname or IP address of the logFaces receiver
* `port` - `integer` (optional, defaults to 55201) - port the logFaces receiver is listening on
* `application` - `string` (optional, defaults to empty string) - used to identify your application's logs

This appender will also pick up Logger context values from the events, and add them as `p_` values in the logFaces event. See the example below for more details.

# Example (default config)

```javascript
log4js.configure({
  appenders: {
    logfaces: { type: '@log4js-node/logfaces-udp' }
  },
  categories: {
    default: { appenders: [ 'logfaces' ], level: 'info' }
  }
});

const logger = log4js.getLogger();
logger.addContext('requestId', '123');
logger.info('some interesting log message');
logger.error('something has gone wrong');
```
This example will result in two log events being sent via UDP to `127.0.0.1:55201`. Both events will have a `p_requestId` property with a value of `123`.
npm package: @log4js-node/loggly
Description: Loggly Appender for log4js-node
Author: Gareth Jones
Latest version: 1.0.0

# Loggly Appender for Log4JS

Sends logging events to [Loggly](https://www.loggly.com), optionally adding tags. This appender uses [node-loggly-bulk](https://www.npmjs.com/package/node-loggly-bulk). Consult the docs for node-loggly-bulk, or loggly itself, if you want more information on the configuration options below.

## Installation

`npm install @log4js-node/loggly`

(This is a plug-in appender for [log4js](https://log4js-node.github.io/log4js-node/), so you'll need that as well)


## Configuration

* `type` - `@log4js-node/loggly`
* `token` - `string` - your really long input token
* `subdomain` - `string` - your subdomain
* `auth` - `object` (optional) - authentication details
  * `username` - `string`
  * `password` - `string`
* `tags` - `Array<string>` (optional) - tags to include in every log message

This appender will scan the msg from the logging event, and pull out any argument of the
shape `{ tags: [] }` so that it's possible to add additional tags in a normal logging call. See the example below.

## Example

```javascript
log4js.configure({
  appenders: {
    loggly: {
      type: 'loggly',
      token: 'somethinglong',
      subdomain: 'your.subdomain',
      tags: [ 'tag1' ]
    }
  },
  categories: {
    default: { appenders: ['loggly'], level: 'info' }
  }
});

const logger = log4js.getLogger();
logger.info({ tags: ['my-tag-1', 'my-tag-2'] }, 'Some message');
```

This will result in a log message being sent to loggly with the tags `tag1`, `my-tag-1`, `my-tag-2`.
npm package: @log4js-node/logstash-http
Description: Logstash HTTP Appender for log4js-node
Author: Gareth Jones
Latest version: 1.1.0

# logstash Appender (HTTP) for log4js-node

The logstash appenders for [log4js](https://log4js-node.github.io/log4js-node) send NDJSON formatted log events to [logstash](https://www.elastic.co/products/logstash) receivers. This appender uses HTTP to send the events (there is another logstash appender that uses [UDP](https://github.com/log4js-node/logstashUDP)).

```bash
npm install log4js @log4js-node/logstash-http
```

## Configuration

* `type` - `@log4js-node/logstash-http`
* `url` - `string` - logFaces receiver servlet URL
* `application` - `string` (optional) - used to identify your application's logs
* `logChannel` - `string` (optional) - also used to identify your application's logs [but in a more specific way]
* `logType` - `string` (optional) - used for the `type` field in the logstash data
* `timeout` - `integer` (optional, defaults to 5000ms) - the timeout for the HTTP request.

This appender will also pick up Logger context values from the events, and add them as `p_` values in the logFaces event. See the example below for more details.

# Example (default config)

```javascript
log4js.configure({
  appenders: {
    logstash: { type: '@log4js-node/logstash-http', url: 'http://localhost:9200/_bulk', application: 'logstash-log4js', logType: 'application', logChannel: 'node' }
  },
  categories: {
    default: { appenders: [ 'logstash' ], level: 'info' }
  }
});

const logger = log4js.getLogger();
logger.addContext('requestId', '123');
logger.info('some interesting log message');
logger.error('something has gone wrong');
```
This example will result in two log events being sent to your `localhost:9200`. Both events will have a `context.requestId` property with a value of `123`.
npm package: @log4js-node/mailgun
Description: Mailgun Appender for log4js-node
Author: Gareth Jones
Latest version: 1.0.0

# Mailgun Appender for Log4JS

This is an optional appender for [log4js-node](https://log4js-node.github.io/log4js-node/).

```bash
npm install @log4js-node/mailgun
```

This appender uses the [mailgun](https://www.mailgun.com) service to send log messages as emails. It uses the [mailgun-js](https://www.npmjs.com/package/mailgun-js) package.

## Configuration

* `type` - `@log4js-node/mailgun`
* `apiKey` - `string` - your mailgun API key
* `domain` - `string` - your domain
* `from` - `string`
* `to` - `string`
* `subject` - `string`
* `layout` - `object` (optional, defaults to basicLayout) - see [layouts](layouts.md)

The body of the email will be the result of applying the layout to the log event. Refer to the mailgun docs for how to obtain your API key.

## Example

```javascript
log4js.configure({
  appenders: {
    type: '@log4js-node/mailgun',
    apiKey: '123456abc',
    domain: 'some.company',
    from: 'logging@some.service',
    to: 'important.bosses@some.company',
    subject: 'Error: Developers Need To Be Fired'
  }
});
```
npm package: @log4js-node/rabbitmq
Description: RabbitMQ Appender for log4js-node
Author: Gareth Jones
Latest version: 2.0.0

# RabbitMQ Appender for Log4JS

Push log events to a [Rabbitmq](https://www.rabbitmq.com/) MQ. Require [log4js-node](https://github.com/log4js-node/log4js-node) 2.x or later.

```bash
npm install @log4js-node/rabbitmq
```

If you want to be sure that all messages have been sent before your programme exits, remember to call `log4js.shutdown(<callback function>)`.

## Configuration

* `type` - `@log4js-ndoe/rabbitmq`
* `host` - `string` (optional, defaults to `127.0.0.1`) - the location of the rabbitmq server
* `port` - `integer` (optional, defaults to `5672`) - the port the rabbitmq server is listening on
* `username` - `string` (optional, defaults to `guest`) - username to use when authenticating connection to rabbitmq
* `password` - `string` (optional, defaults to `guest`) - password to use when authenticating connection to rabbitmq
* `routing_key` - `string` (optional, defaults to `logstash`) - rabbitmq message's routing_key
* `durable` - `string` (optional, defaults to false) - will that RabbitMQ lose our queue.
* `exchange` - `string` (optional, defaults to `log`)- rabbitmq send message's exchange
* `mq_type` - `string` (optional, defaults to `direct`) - rabbitmq message's mq_type
* `vhost` - `string` (optional, defaults to `/`) - vhost to use
* `layout` - `object` (optional, defaults to `messagePassThroughLayout`) - the layout to use for log events (see [layouts](layouts.md)).
* `shutdownTimeout` - `integer` (optional, defaults to `10000`) - maximum time in milliseconds to wait for messages to be sent during log4js shutdown.

The appender will use the RabbitMQ Routing model command to send the log event messages to the channel.

## Example

```javascript
log4js.configure({
  appenders: {
    mq: {
      type: '@log4js-node/rabbitmq',
      host: '127.0.0.1',
      port: 5672,
      username: 'guest',
      password: 'guest',
      routing_key: 'logstash',
      exchange: 'exchange_logs',
      mq_type: 'direct',
      durable: true
    }
  },
  categories: { default: { appenders: ['mq'], level: 'info' } }
});
```

This configuration will push log messages to the rabbitmq on `127.0.0.1:5672`.
npm package: @log4js-node/redis
Description: Redis Appender for log4js-node
Author: Gareth Jones
Latest version: 1.0.0

# Redis Appender for log4js-node

Stores log events in a [Redis](https://redis.io) database. Plugin for log4js > 2.x
```bash
npm install @log4js-node/redis
```

## Configuration

* `type` - `redis`
* `host` - `string` (optional, defaults to `127.0.0.1`) - the location of the redis server
* `port` - `integer` (optional, defaults to `6379`) - the port the redis server is listening on
* `pass` - `string` (optional) - password to use when authenticating connection to redis
* `channel` - `string` - the redis channel that log events will be published to
* `layout` - `object` (optional, defaults to `messagePassThroughLayout`) - the layout to use for log events (see [layouts](layouts.md)).

The appender will use the Redis PUBLISH command to send the log event messages to the channel.

## Example

```javascript
log4js.configure({
  appenders: {
    redis: { type: 'redis', channel: 'logs' }
  },
  categories: { default: { appenders: ['redis'], level: 'info' } }
});
```

This configuration will publish log messages to the `logs` channel on `127.0.0.1:6379`.
npm package: @log4js-node/slack
Description: Slack Appender for log4js-node
Author: Gareth Jones
Latest version: 1.0.0

# Slack Appender for log4js-node

Sends log events to a [slack](https://slack.com) channel. This is an optional appender for use with [log4js](https://log4js-node.github.io/log4js-node/).
```bash
npm install @log4js-node/slack
```

## Configuration

* `type` - `@log4js-node/slack`
* `token` - `string` - your Slack API token (see the slack and slack-node docs)
* `channel_id` - `string` - the channel to send log messages
* `icon_url` - `string` (optional) - the icon to use for the message
* `username` - `string` - the username to display with the message
* `layout` - `object` (optional, defaults to `basicLayout`) - the layout to use for the message (see [layouts](layouts.md)).

## Example

```javascript
log4js.configure({
  appenders: {
    alerts: {
      type: '@log4js-node/slack',
      token: 'abc123def',
      channel_id: 'prod-alerts',
      username: 'our_application'
    }
  },
  categories: {
    default: { appenders: ['alerts'], level: 'error' }
  }
});
```
This configuration will send all error (and above) messages to the `prod-alerts` slack channel, with the username `our_application`.