New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gc-json-logger

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gc-json-logger

Log JSON entries to stdout/stderr to be queried in Google Cloud Monitoring

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
721
decreased by-31.79%
Maintainers
1
Weekly downloads
 
Created
Source

Logger to enable structured logging in GKE powered projects

Allows printing structured logs to stdout, stderr for further action in Google Cloud platform. Given that log agent ingests logs from stdout streams when running in GKE.

NPM Coverage Status Health License Runkit

Precaution

A logger makes use of async_hooks module which is currently experimental. However, the use of async_hooks mechanism was at basic.

Installation

npm install --save gc-json-logger

yarn add gc-json-logger

View in Google Cloud Logging

Google Cloud Logging

Integration

const { Logger } = require('gc-json-logger');

const app = Logger.getLogger('app');

app.info('main'); // Logs as "app"
Logger.getLogger().info('main'); // Logs as "app"
Logger.getLogger('app').info('main'); // Logs as "app"

setTimeout(() => {
  const id = 'abc';
  const logger = Logger.getLogger(id);
  logger.info('context'); // Logs as "id"
  Logger.getLogger().info('context'); // Logs as "id"
  Logger.getLogger(id).info('context'); // Logs as "id"

  const custom = Logger.getLogger('custom');
  custom.info('context'); // Logs as "custom"
});

Keywords

FAQs

Package last updated on 25 Oct 2022

Did you know?

Socket

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.

Install

Related posts

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