Skip to content

Commit

Permalink
chore: deprecate logstash http appender
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Jones committed Jul 1, 2018
1 parent d164421 commit 9371871
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
2 changes: 1 addition & 1 deletion docs/appenders.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ The following appenders are included with log4js. Some require extra dependencie
* [logFaces-HTTP](logFaces-HTTP.md)
* [logFaces-UDP](logFaces-UDP.md)
* [logLevelFilter](logLevelFilter.md)
* [logstashHTTP](logstashHTTP.md)
* [multiFile](multiFile.md)
* [multiprocess](multiprocess.md)
* [recording](recording.md)
Expand All @@ -41,6 +40,7 @@ The following appenders are supported by log4js, but will issue deprecation warn
* [gelf](https://github.com/log4js-node/gelf)
* [hipchat](https://github.com/log4js-node/hipchat)
* [loggly](https://github.com/log4js-node/loggly)
* [logstashHTTP](https://github.com/log4js-node/logstashHTTP)
* [logstashUDP](https://github.com/log4js-node/logstashUDP)
* [mailgun](https://github.com/log4js-node/mailgun)
* [rabbitmq](https://github.com/log4js-node/rabbitmq)
Expand Down
33 changes: 0 additions & 33 deletions docs/logstashHTTP.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/logstashHTTP.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ log4js.configure({
},
logstash: {
url: 'http://172.17.0.5:9200/_bulk',
type: 'logstashHTTP',
type: '@log4js-node/logstash-http',
logType: 'application',
logChannel: 'node',
application: 'logstash-log4js',
Expand Down
8 changes: 7 additions & 1 deletion lib/appenders/logstashHTTP.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* This appender is deprecated, please apply any bugfixes or changes
* to https://github.com/log4js-node/logstash-http
* logstashHTTP appender sends JSON formatted log events to logstashHTTP receivers.
*
* HTTP require 'axios', see 'https://www.npmjs.com/package/axios'
Expand Down Expand Up @@ -31,7 +33,7 @@ function logstashHTTPAppender(config) {
withCredentials: true,
});

return function log(event) {
const appender = function log(event) {
const logstashEvent = [
{
index: {
Expand Down Expand Up @@ -61,6 +63,10 @@ function logstashHTTPAppender(config) {
console.error(`log4js.logstashHTTP Appender error: ${error.message}`);
});
};

appender.deprecated = '@log4js-node/logstash-http';

return appender;
}

function configure(config) {
Expand Down

0 comments on commit 9371871

Please sign in to comment.