Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RFC5424 timestamps #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/winston-syslog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const dgram = require('dgram');
const net = require('net');
const secNet = require('tls');
const utils = require('./utils');
const glossy = require('glossy');
const glossy = require('@myndzi/glossy');
const winston = require('winston');
const Transport = require('winston-transport');
const { MESSAGE, LEVEL } = require('triple-beam');
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"syslog"
],
"dependencies": {
"glossy": "^0.1.7"
"@myndzi/glossy": "^0.1.11"
},
"optionalDependencies": {
"unix-dgram": "2.0.3"
Expand Down
12 changes: 10 additions & 2 deletions test/format-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const vows = require('vows');
const assert = require('assert');
const Syslog = require('../lib/winston-syslog.js').Syslog;
const dgram = require('dgram');
const parser = require('glossy').Parse;
const parser = require('@myndzi/glossy').Parse;

const PORT = 11229;
let server;
Expand Down Expand Up @@ -69,7 +69,7 @@ vows
assert.notEqual(msg.host, 'localhost');
transport.close();
},
'setting appName option to hello': {
'setting appName option to hello and type to 5424': {
'topic': function () {
const self = this;
server.once('message', function (msg) {
Expand All @@ -93,6 +93,14 @@ vows
},
'should have appName field set to hello': function (msg) {
assert.equal(msg.appName, 'hello');
},
'should have proper time zone': function (msg) {
const now = new Date();
assert.equal((Math.abs((now - msg.time) / 1000) < 300), true);
},
'should have proper milliseconds format': function (msg) {
const milliseconds = msg.originalMessage.split(' ')[1].slice(20, 23);
assert.equal(isNaN(milliseconds), false);
transport.close();
},
'setting app_name option to hello': {
Expand Down
2 changes: 1 addition & 1 deletion test/unix-connect-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs');
const vows = require('vows');
const assert = require('assert');
const unix = require('unix-dgram');
const parser = require('glossy').Parse;
const parser = require('@myndzi/glossy').Parse;
const Syslog = require('../lib/winston-syslog').Syslog;

const { MESSAGE, LEVEL } = require('triple-beam');
Expand Down