Comments (7)
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.
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.
@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.
{ "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 }
from node-gelf-pro.
Are you sure that the input is GELF TCP
? It looks like this one is Syslog.
from node-gelf-pro.
@kkamkou you are right! Thank you for the help that you gave me and many compliments for your grate job.
from node-gelf-pro.
thx for the feedback, you're welcome.
from node-gelf-pro.
Related Issues (20)
- Drop support of dead node.js releases (end-of-life versions)
- Delays releasing UDP port on DNS timeout. HOT 1
- Can I use multiple GELF configurations? HOT 2
- Manually setting levels or aliases doesn't expose corresponding methods
- Compatibility HOT 5
- Update lodash version - security vulnerability
- Why is id field dropped from message? HOT 6
- Compatibility with Graylog 3 HOT 1
- Angular support HOT 1
- socket reuse HOT 3
- Validation for a custom short_message field HOT 3
- UDP Adapter: Ability to pass dgram options HOT 2
- Crash on setConfig method HOT 3
- Typescript: Property 'info' does not exist on type 'typeof import("gelf-pro") ... HOT 1
- ERR_SOCKET_DGRAM_NOT_RUNNING error when chunking request body(fix suggested) HOT 1
- Unstable sending of chunked messages HOT 2
- Dynamic import issue when a bundle package in ESM with node-gelf-pro HOT 1
- Is there a way to integrate this package with winston?
- Test failing with Uncaught AssertionError on node 21
- Beautify json HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-gelf-pro.