Skip to content

Commit

Permalink
chore: deprecated logFaces-UDP
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Jones committed Jul 11, 2018
1 parent 111fced commit db9271b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 38 deletions.
2 changes: 1 addition & 1 deletion docs/appenders.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ The following appenders are included with log4js. Some require extra dependencie
* [dateFile](dateFile.md)
* [file](file.md)
* [fileSync](fileSync.md)
* [logFaces-UDP](logFaces-UDP.md)
* [logLevelFilter](logLevelFilter.md)
* [multiFile](multiFile.md)
* [multiprocess](multiprocess.md)
Expand All @@ -39,6 +38,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)
* [logFaces-HTTP](https://github.com/log4js-node/logFaces-HTTP)
* [logFaces-UDP](https://github.com/log4js-node/logFaces-UDP)
* [loggly](https://github.com/log4js-node/loggly)
* [logstashHTTP](https://github.com/log4js-node/logstashHTTP)
* [logstashUDP](https://github.com/log4js-node/logstashUDP)
Expand Down
31 changes: 0 additions & 31 deletions docs/logFaces-UDP.md

This file was deleted.

10 changes: 5 additions & 5 deletions examples/logFaces-appender.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const log4js = require('../lib/log4js');
log4js.configure({
appenders: {
logFaces: {
type: 'logFaces-UDP', // (mandatory) appender type
application: 'MY-NODEJS', // (optional) name of the application (domain)
remoteHost: 'localhost', // (optional) logFaces server host or IP address
port: 55201, // (optional) logFaces UDP receiver port (must use JSON format)
layout: { // (optional) the layout to use for messages
type: '@log4js-node/logfaces-udp', // (mandatory) appender type
application: 'MY-NODEJS', // (optional) name of the application (domain)
remoteHost: 'localhost', // (optional) logFaces server host or IP address
port: 55201, // (optional) logFaces UDP receiver port (must use JSON format)
layout: { // (optional) the layout to use for messages
type: 'pattern',
pattern: '%m'
}
Expand Down
8 changes: 7 additions & 1 deletion lib/appenders/logFaces-UDP.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/**
* This appender has been deprecated. Any bug fixes or improvements should be
* made against https://github.com/log4js-node/logFaces-UDP
*
* logFaces appender sends JSON formatted log events to logFaces receivers.
* There are two types of receivers supported - raw UDP sockets (for server side apps),
* and HTTP (for client side apps). Depending on the usage, this appender
Expand Down Expand Up @@ -43,7 +46,7 @@ function datagram(config) {
function logFacesUDPAppender(config) {
const send = datagram(config);

return function log(event) {
const appender = function log(event) {
// convert to logFaces compact json format
const lfsEvent = {
a: config.application || '', // application name
Expand All @@ -61,6 +64,9 @@ function logFacesUDPAppender(config) {
// send to server
send(lfsEvent);
};

appender.deprecated = '@log4js-node/logfaces-udp';
return appender;
}

function configure(config) {
Expand Down

0 comments on commit db9271b

Please sign in to comment.