Git Product home page Git Product logo

Comments (7)

kkamkou avatar kkamkou commented on July 16, 2024

Please paste the way you call message(). Whereas message() is the low-level function for deep integration with 3rd parties, you might want to use: .info('hello', {world: 555}). .error('test', {payload: 'bbb'}) and so on.

message() function example is: .message('hello', 7, {world: 555}). Where 7 is link to this one.

from node-gelf-pro.

beinnova avatar beinnova commented on July 16, 2024
	Gelf.setConfig({
		fields: {facility: 'log-service-tcp', owner: 'Josh'}, // optional; default fields for all messages
		transform: [
			function(message) {
				message.short_message = message.message;
				message.facility = message.service || 'no service';
				message.level = message.type;

				return message;

			}
		],
		adapterName: 'tcp', // optional; currently supported "udp", "tcp" and "tcp-tls"; default: udp
		adapterOptions: { // this object is passed to the adapter.connect() method
		        //common
			host:configs.host, // optional; default: 127.0.0.1
			port: configs.port, // optional; default: 12201
			// tcp adapter example
			family: 4, // tcp only; optional; version of IP stack; default: 4
			timeout: 1000, // tcp only; optional; default: 10000 (10 sec)
		}
	});

	this._priv.graylog = Gelf;


			this._priv.graylog.message(message.message, 7, message,  function(err, bytesSent) {
				console.log(bytesSent);
				callback && callback(err);
			});
full_message

{"version":"1.1","short_message":"An error occurred while attempting to stop a monitor manager.","timestamp":1509116478.396,"host":"ncc-1701-c","level":"warn","_facility":"template service","_owner":"Josh","_message":"An error occurred while attempting to stop a monitor manager.","_configs":"[object Object]","_error_errorId":160205,"_error_internalStack":"    at FS.stop (/application/node_modules/cam-resource-monitor/lib/monitor/manager/plugins/fs.js:168:25),    at Manager.stop (/application/node_modules/cam-resource-monitor/lib/monitor/manager/index.js:156:21),    at Monitor.<anonymous> (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:145:33),    at Object.async.whilst (/application/node_modules/async/lib/async.js:792:13),    at Monitor.stop (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:137:9),    at Monitor.<anonymous> (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:96:10),    at /application/node_modules/async/lib/async.js:52:16,    at /application/node_modules/async/lib/async.js:361:13,    at /application/node_modules/async/lib/async.js:52:16","_error_instance":1509099436003,"_error_retry":"false","_hostname":"camlinux4","_file":"/application/node_modules/cam-resource-monitor/lib/monitor/index.js","_service":"template service","_date":"2017-10-27T10:17:16.007Z","_type":"warn","_subType":""}
level

-1
message

{"version":"1.1","short_message":"An error occurred while attempting to stop a monitor manager.","timestamp":1509116478.396,"host":"ncc-1701-c","level":"warn","_facility":"template service","_owner":"Josh","_message":"An error occurred while attempting to stop a monitor manager.","_configs":"[object Object]","_error_errorId":160205,"_error_internalStack":"    at FS.stop (/application/node_modules/cam-resource-monitor/lib/monitor/manager/plugins/fs.js:168:25),    at Manager.stop (/application/node_modules/cam-resource-monitor/lib/monitor/manager/index.js:156:21),    at Monitor.<anonymous> (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:145:33),    at Object.async.whilst (/application/node_modules/async/lib/async.js:792:13),    at Monitor.stop (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:137:9),    at Monitor.<anonymous> (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:96:10),    at /application/node_modules/async/lib/async.js:52:16,    at /application/node_modules/async/lib/async.js:361:13,    at /application/node_modules/async/lib/async.js:52:16","_error_instance":1509099436003,"_error_retry":"false","_hostname":"camlinux4","_file":"/application/node_modules/cam-resource-monitor/lib/monitor/index.js","_service":"template service","_date":"2017-10-27T10:17:16.007Z","_type":"warn","_subType":""}
source

194.143.183.65
timestamp

2017-10-27T15:01:22.733Z

I've tried with other function like .info() or .warn() but the result as the same. Actually, I would like to send a raw object is is it possible.

from node-gelf-pro.

kkamkou avatar kkamkou commented on July 16, 2024

@beinnova Could you create a screenshot of the graylog input settings and post the raw message you're trying to send?

from node-gelf-pro.

beinnova avatar beinnova commented on July 16, 2024

@kkamkou

{ "message" : "An error occurred while attempting to stop a monitor manager.", "configs" : [ { "env" : "resource-monitor", "globals" : "resource-monitor", "resourceExpires" : 60000, "thumbnailExpires" : 60000, "createThumbnailDelay" : 500, "resourceGlob" : "+(xar|web|jpg|jpeg|png)", "thumbnailGlob" : "+(jpg|jpeg|png)", "directoryThumbnailName" : "folder-image.png", "mongo" : { "host" : "127.0.0.1", "port" : 27017, "database" : "Resources", "collection" : "folders" }, "type" : "fs", "identifier" : "templates", "filter" : {  }, "root" : "/application_templates/DevTemplates", "scanMaxDepth" : 10, "thumbnailsFolderName" : "xarainfo", "thumbnailURL" : "http://camlinux4.ixara.com/images/thumbnail/{0}" } ], "error" : { "errorId" : 160205, "internalStack" : [ "    at FS.stop (/application/node_modules/cam-resource-monitor/lib/monitor/manager/plugins/fs.js:168:25)", "    at Manager.stop (/application/node_modules/cam-resource-monitor/lib/monitor/manager/index.js:156:21)", "    at Monitor.<anonymous> (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:145:33)", "    at Object.async.whilst (/application/node_modules/async/lib/async.js:792:13)", "    at Monitor.stop (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:137:9)", "    at Monitor.<anonymous> (/application/node_modules/cam-resource-monitor/lib/monitor/index.js:96:10)", "    at /application/node_modules/async/lib/async.js:52:16", "    at /application/node_modules/async/lib/async.js:361:13", "    at /application/node_modules/async/lib/async.js:52:16" ], "instance" : 1509099436003, "retry" : false }, "hostname" : "camlinux4", "file" : "/application/node_modules/cam-resource-monitor/lib/monitor/index.js", "service" : "template service", "date" : "2017-10-27T10:17:16.007Z", "type" : "warn", "subType" : null } 

schermata del 2017-10-30 09-59-27
schermata del 2017-10-30 10-00-31

from node-gelf-pro.

kkamkou avatar kkamkou commented on July 16, 2024

Are you sure that the input is GELF TCP? It looks like this one is Syslog.

from node-gelf-pro.

beinnova avatar beinnova commented on July 16, 2024

@kkamkou you are right! Thank you for the help that you gave me and many compliments for your grate job.

from node-gelf-pro.

kkamkou avatar kkamkou commented on July 16, 2024

thx for the feedback, you're welcome.

from node-gelf-pro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.