diff --git a/docs/appenders.md b/docs/appenders.md index d47bc773..143bdc41 100644 --- a/docs/appenders.md +++ b/docs/appenders.md @@ -27,7 +27,6 @@ The following appenders are included with log4js. Some require extra dependencie * [hipchat](hipchat.md) * [logFaces-HTTP](logFaces-HTTP.md) * [logFaces-UDP](logFaces-UDP.md) -* [loggly](loggly.md) * [logLevelFilter](logLevelFilter.md) * [logstashHTTP](logstashHTTP.md) * [logstashUDP](logstashUDP.md) @@ -47,6 +46,7 @@ The following appenders are included with log4js. Some require extra dependencie The following appenders are supported by log4js, but will issue deprecation warnings from version 2.6 onwards - they will be removed from the log4js core in version 3. If you are using these appenders, you should alter your dependencies to include them explicitly. * [gelf](https://github.com/log4js-node/gelf) +* [loggly](https://github.com/log4js-node/loggly) For example, if you were previously using the gelf appender (`type: 'gelf'`) then you should add `@log4js-node/gelf` to your dependencies and change the type to `type: '@log4js-node/gelf'`. diff --git a/docs/index.md b/docs/index.md index 1cd4ec73..ecc4c9db 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,7 +13,7 @@ There have been a few changes between log4js 1.x and 2.x (and 0.x too). You shou * [file appender](file.md), with configurable log rolling based on file size or [date](dateFile.md) * [SMTP appender](smtp.md) * [GELF appender](https://github.com/log4js-node/gelf) -* [Loggly appender](loggly.md) +* [Loggly appender](https://github.com/log4js-node/loggly) * [Logstash UDP appender](logstashUDP.md) * logFaces ([UDP](logFaces-UDP.md) and [HTTP](logFaces-HTTP.md)) appender * [multiprocess appender](multiprocess.md) (useful when you've got multiple servers but want to centralise logging) diff --git a/docs/loggly.md b/docs/loggly.md deleted file mode 100644 index 0c6e25fb..00000000 --- a/docs/loggly.md +++ /dev/null @@ -1,36 +0,0 @@ -# Loggly Appender - -Sends logging events to [Loggly](https://www.loggly.com), optionally adding tags. This appender uses [node-loggly](https://www.npmjs.com/package/loggly), and you will need to include that in your dependencies if you want to use this appender. Consult the docs for node-loggly, or loggly itself, if you want more information on the configuration options below. - -## Configuration - -* `type` - `loggly` -* `token` - `string` - your really long input token -* `subdomain` - `string` - your subdomain -* `tags` - `Array` (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`. diff --git a/lib/appenders/loggly.js b/lib/appenders/loggly.js index 84c41d13..285888d4 100644 --- a/lib/appenders/loggly.js +++ b/lib/appenders/loggly.js @@ -2,6 +2,10 @@ 'use strict'; +/** + * This appender has been deprecated. + * Updates and bug fixes should be made against https://github.com/log4js-node/loggly + */ const debug = require('debug')('log4js:loggly'); const loggly = require('loggly'); const os = require('os'); @@ -105,6 +109,9 @@ function logglyAppender(config, layout) { } }; + // trigger a deprecation warning, with a pointer to the replacement lib + app.deprecated = '@log4js-node/loggly'; + return app; }