Skip to content

Commit db9271b

Browse files
author
Gareth Jones
committed
chore: deprecated logFaces-UDP
1 parent 111fced commit db9271b

File tree

4 files changed

+13
-38
lines changed

4 files changed

+13
-38
lines changed

docs/appenders.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ The following appenders are included with log4js. Some require extra dependencie
2424
* [dateFile](dateFile.md)
2525
* [file](file.md)
2626
* [fileSync](fileSync.md)
27-
* [logFaces-UDP](logFaces-UDP.md)
2827
* [logLevelFilter](logLevelFilter.md)
2928
* [multiFile](multiFile.md)
3029
* [multiprocess](multiprocess.md)
@@ -39,6 +38,7 @@ The following appenders are supported by log4js, but will issue deprecation warn
3938
* [gelf](https://github.com/log4js-node/gelf)
4039
* [hipchat](https://github.com/log4js-node/hipchat)
4140
* [logFaces-HTTP](https://github.com/log4js-node/logFaces-HTTP)
41+
* [logFaces-UDP](https://github.com/log4js-node/logFaces-UDP)
4242
* [loggly](https://github.com/log4js-node/loggly)
4343
* [logstashHTTP](https://github.com/log4js-node/logstashHTTP)
4444
* [logstashUDP](https://github.com/log4js-node/logstashUDP)

docs/logFaces-UDP.md

-31
This file was deleted.

examples/logFaces-appender.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const log4js = require('../lib/log4js');
88
log4js.configure({
99
appenders: {
1010
logFaces: {
11-
type: 'logFaces-UDP', // (mandatory) appender type
12-
application: 'MY-NODEJS', // (optional) name of the application (domain)
13-
remoteHost: 'localhost', // (optional) logFaces server host or IP address
14-
port: 55201, // (optional) logFaces UDP receiver port (must use JSON format)
15-
layout: { // (optional) the layout to use for messages
11+
type: '@log4js-node/logfaces-udp', // (mandatory) appender type
12+
application: 'MY-NODEJS', // (optional) name of the application (domain)
13+
remoteHost: 'localhost', // (optional) logFaces server host or IP address
14+
port: 55201, // (optional) logFaces UDP receiver port (must use JSON format)
15+
layout: { // (optional) the layout to use for messages
1616
type: 'pattern',
1717
pattern: '%m'
1818
}

lib/appenders/logFaces-UDP.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/**
2+
* This appender has been deprecated. Any bug fixes or improvements should be
3+
* made against https://github.com/log4js-node/logFaces-UDP
4+
*
25
* logFaces appender sends JSON formatted log events to logFaces receivers.
36
* There are two types of receivers supported - raw UDP sockets (for server side apps),
47
* and HTTP (for client side apps). Depending on the usage, this appender
@@ -43,7 +46,7 @@ function datagram(config) {
4346
function logFacesUDPAppender(config) {
4447
const send = datagram(config);
4548

46-
return function log(event) {
49+
const appender = function log(event) {
4750
// convert to logFaces compact json format
4851
const lfsEvent = {
4952
a: config.application || '', // application name
@@ -61,6 +64,9 @@ function logFacesUDPAppender(config) {
6164
// send to server
6265
send(lfsEvent);
6366
};
67+
68+
appender.deprecated = '@log4js-node/logfaces-udp';
69+
return appender;
6470
}
6571

6672
function configure(config) {

0 commit comments

Comments
 (0)