
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
pino-cloud-logging
Advanced tools
This package provides a [simple configuration][] to use with [Pino][] to make it adhere to Google Cloud Logging [structured logging][].
This package provides a simple configuration to use with Pino to make it adhere to Google Cloud Logging structured logging.
yarn add pino-cloud-logging
When you initialize your Pino logging instance, you'll use our gcpLogOptions
.
import Pino from 'pino';
import { gcpLogOptions } from 'pino-cloud-logging';
const logger = Pino(gcpLogOptions());
logger.info('Hello 👋');
You can extend the configuration provided by this package like this:
gcpLogOptions({
level: 'INFO',
// Options can be found here:
// https://github.com/pinojs/pino/blob/master/docs/api.md#options
});
You can also provide some of the default context like this:
gcpLogOptions(
{
/* ... */
},
{ serviceName: 'hello-world', version: '2020-01-01' },
);
If you want to provide insertId
(or any other runtime data), you can add those
with the mixin
function.
gcpLogOptions(
{
/* ... */
},
{ mixin: () => ({ insertId: randomUUID() }) },
);
Or even provide context from OpenTelemetry.
import { context, getSpan } from '@opentelemetry/api';
gcpLogOptions(
{
/* ... */
},
{ mixin: () => getSpan(context.active())?.context() ?? {} },
);
FAQs
This package provides a [simple configuration][] to use with [Pino][] to make it adhere to Google Cloud Logging [structured logging][].
The npm package pino-cloud-logging receives a total of 7,792 weekly downloads. As such, pino-cloud-logging popularity was classified as popular.
We found that pino-cloud-logging 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.