
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Graylog2 client library for Node.js
require("graylog");
Short message:
log("What we've got here is...failure to communicate");
Long message:
log("What we've got here is...failure to communicate", "Some men you just
can't reach. So you get what we had here last week, which is the way he wants
it... well, he gets it. I don't like it any more than you men.");
Short with options:
log("What we've got here is...failure to communicate", { level: LOG_DEBUG });
Long with options:
log("What we've got here is...failure to communicate", "Some men you just
can't reach. So you get what we had here last week, which is the way he wants
it... well, he gets it. I don't like it any more than you men.",
{
facility: "Steve Martin"
}
);
You can add custom fields to the options:
log("What we've got here", {
level: LOG_DEBUG,
_failure: "to communicate"
});
facility
- by default it's set to GLOBAL.graylogFacility
.level
- syslog levels, one of: LOG_EMERG
, LOG_ALERT
, LOG_CRIT
, LOG_ERR
, LOG_WARNING
, LOG_NOTICE
, LOG_INFO
(default), LOG_DEBUG
.timestamp
- unixtime of log event, by default it's now.host
- by default, it's auto detected.stack
- if set to true
, log will contain source file name and line number.You can set GLOBAL.graylogHost
and GLOBAL.graylogPort
to the host and port of the Graylog2 server. By defaults it's localhost
and 12201
.
You can set GLOBAL.graylogToConsole
to true
to log JSON entries to console as well (useful for development in case you don't want to have graylog2 running on your workstation).
You should set GLOBAL.graylogFacility
to the name of your application. By default it's set to "Node.js".
You can set GLOBAL.graylogSequence
to a integer non-zero value (set it to 1) to have an auto-incremented _graylogSequence
field sent to graylog with each log entry. Due to the fact that UDP packets are not guaranteed to be received in the same order as sent, you might need a sequence number to recover the course of events.
You can set GLOBAL.graylogChunkSize
to the maximum allowed bytes for a single UDP packet. Log messages higher than that will be sent in chunked encoding.
See sayHello.js
.
I know, it's wrong. However I like it that way and I truly believe that logger function must be the easiest to call for the programmer to never hesitate using it. So I think that logger functions should be one of the extremely few cases where global namespace pollution is feasible.
It's a miracle. Get it at http://www.graylog2.org/
npm install .
See LICENSE file. Basically, it's a kind of "do-whatever-you-want-for-free" license.
Egor Egorov me@egorfine.com.
FAQs
Graylog2 client library for node.js
The npm package graylog receives a total of 4 weekly downloads. As such, graylog popularity was classified as not popular.
We found that graylog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.