Skip to content

Commit

Permalink
Glossy takes a app_id parameter to help identify the \"App\" that is …
Browse files Browse the repository at this point in the history
…logging messages. Adding support for this. You can pass an app_id in options when calling the constructor or let it default to the process.title
  • Loading branch information
Dan Thurman committed Feb 17, 2012
1 parent 8c9c9aa commit f9b706e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/winston-syslog.js
Expand Up @@ -45,6 +45,7 @@ var Syslog = exports.Syslog = function (options) {
this.host = options.host || 'localhost';
this.port = options.port || 514;
this.path = options.path || null;
this.app_id = options.app_id || null;
this.protocol = options.protocol || 'udp4';
this.isDgram = /^udp|unix/.test(this.protocol);

Expand Down Expand Up @@ -113,6 +114,7 @@ Syslog.prototype.log = function (level, msg, meta, callback) {
syslogMsg = this.producer.produce({
severity: level,
host: this.localhost,
app_id: this.app_id || process.title,
date: new Date(),
message: JSON.stringify(data)
});
Expand Down

0 comments on commit f9b706e

Please sign in to comment.