Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/log4js-node/loggly
Loggly Appender for Log4JS
https://github.com/log4js-node/loggly
Last synced: 3 months ago
JSON representation
Loggly Appender for Log4JS
- Host: GitHub
- URL: https://github.com/log4js-node/loggly
- Owner: log4js-node
- License: apache-2.0
- Created: 2018-02-22T21:04:48.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-08T00:10:45.000Z (over 1 year ago)
- Last Synced: 2024-10-31T10:37:32.888Z (3 months ago)
- Language: JavaScript
- Size: 1.15 MB
- Stars: 5
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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` (optional) - tags to include in every log messageThis 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: '@log4js-node/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`.