3.1.4 • Published 1 year ago

stackdriver-logging-node v3.1.4

Weekly downloads
21
License
ISC
Repository
-
Last release
1 year ago

Simplified stackdriver stream creation with bunyan & logging-bunyan packages

Stackdriver logging node

Install

npm install --save stackdriver-logging-node

Instructions

Stackdriver logging node will automatically create stackdriver stream with package @google-cloud/logging-bunyan.

If you want to disable stackdriver stream, pass option property streamToCloud as false.

Options

Stackdriver logging node takes two parameter in initialization. After initialization, package can be required without parameters or with only single parameter (route).

route Parameter to indicate where log is send.

options Options object for google-bunyan package

options.logName Name of the application. REQUIRED.

options.level Log level. Default value is info.

options.streamToCloud Log cloud streaming mode. Default value is true. On local use, it's recommended to set this value as false.

Example

Initialization

// Example options, use config in real deal
const options = {
  logName: 'example-application', // Required
  level: 'warn', // Optional
  streamToCloud: true // Optional
};

const logger = require('stackdriver-logging-node')(__filename, options);

Parameter options require property logName or environment variable APPLICATION_NAME.

After initalization

Initialization has to be run atleast once before using package like this.

// Can be run without params
const logger = require('stackdriver-logging-node')();
// Or with file trace
const logger = require('stackdriver-logging-node')(__filename);
// Or custom path
const logger = require('stackdriver-logging-node')('/path/to/url');
2.0.6

1 year ago

2.0.5

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.4

2 years ago

2.0.3

2 years ago

2.0.2

3 years ago

2.0.4

2 years ago

3.1.0

3 years ago

3.0.0

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.4

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.0

6 years ago