Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-nodejs-logging-support

Package Overview
Dependencies
Maintainers
5
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-nodejs-logging-support - npm Package Compare versions

Comparing version 6.5.4 to 6.6.0

core/log-core.js

33

index.js
//loading core logger functionality
var coreLogger = require("./cf-nodejs-logging-support-core/log-core");
var coreLogger = require("./core/log-core");
var effectiveLogger = null;

@@ -7,4 +7,4 @@

effectiveLogger = require("./cf-nodejs-logging-support-express/log-express");
defaultConfig = require("./config.js");
effectiveLogger = require("./logger/log-express");
defaultConfig = require("./config");
effectiveLogger.setCoreLogger(coreLogger);

@@ -36,9 +36,9 @@

case "restify":
effectiveLogger = require("./cf-nodejs-logging-support-restify/log-restify");
effectiveLogger = require("./logger/log-restify");
break;
case "plainhttp":
effectiveLogger = require("./cf-nodejs-logging-support-plainhttp/log-plainhttp");
effectiveLogger = require("./logger/log-plainhttp");
break;
default:
effectiveLogger = require("./cf-nodejs-logging-support-express/log-express");
effectiveLogger = require("./logger/log-express");
}

@@ -48,3 +48,22 @@ effectiveLogger.setCoreLogger(coreLogger);

exports.enableTracing = function (input) {
names = [];
if (typeof input == "string")
names.push(input);
else
names = input;
var config = defaultConfig.config;
for(var i in names) {
switch (names[i].toLowerCase()) {
case "sap_passport":
config.push(...require("./trace/sap_passport").config);
break;
default:
}
}
coreLogger.setConfig(config);
return config;
}
exports.logNetwork = function (req, res, next) {

@@ -72,3 +91,3 @@ effectiveLogger.logNetwork(req, res, next);

options.logMessage = coreLogger.logMessage;
return require("./cf-nodejs-logging-support-winston/winston-transport").createTransport(options);
return require("./winston/winston-transport").createTransport(options);
};

@@ -75,0 +94,0 @@

{
"name": "cf-nodejs-logging-support",
"version": "6.5.4",
"version": "6.6.0",
"description": "Logging tool for Cloud Foundry",

@@ -5,0 +5,0 @@ "keywords": [

@@ -235,2 +235,12 @@ # Node.js Logging Support for Cloud Foundry

You can also use this feature from the global logging context like so:
```js
log = require("cf-nodejs-logging-support");
var subLogger = log.createLogger();
subLogger.setCustomFields({"field-a" :"value"})
// OR
var subLogger = log.createLogger({"field-a" :"value"});
```
### Check log severity levels

@@ -448,2 +458,15 @@ In some cases it can be useful to check if messages with a specific severity level would be logged. You can check if a logging level is active as follows:

## Tracing
### SAP_passport
example:
```
2a54482a0300e60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a54482a
```
SAP Passport is an end to end tracing technology used in many SAP products.
It is a binary format encoded in hex notation.
Applications can add the whole SAP Passport in this field or give its constituents in the respective fields.
to read up on the possible fields, please look at [fields](https://github.com/SAP/cf-java-logging-support/blob/master/cf-java-logging-support-core/beats/app-logs/docs/fields.asciidoc).
### Custom sink function

@@ -450,0 +473,0 @@ Per default the library writes output messages to `stdout`. For debugging purposes it can be useful to redirect the output of the library to another sink (e.g. `console.log()`). You can set a custom sink method as follows:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc