Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
log4js-stackdriver-appender
Advanced tools
Readme
a log4js appender for use with the stackdriver on google cloud.
to allow access to google cloud logging please follow setup and access permission on google cloud documentation. You can use Application Default Credentials (ADC) or supply credential in config.
if your code is running on Google Cloud then make sure the proper scopes is setup.
if you running on you local dev server , use gcloud cli to authorize.
By default all logging will be done to file syslog in the "Global" logging section.
If you want you can specify a resource which the log will be written to.
var config ={
appenders: {
google: {
type: 'log4js-stackdriver-appender',
resource: {
type: "container",
labels: {
cluster_name: 'local-dev',
pod_id: process.env["HOSTNAME"],
container_name: ''
}
},
logFileName: 'syslog',
layout: {
type: 'basic'
}
}
},
categories: {
default: {
appenders: ['google'],
level:'DEBUG'
}
}
};
var log4js = require('log4js');
log4js.configure(config);
var logger = log4js.getLogger('local');
logger.debug('somthing');
if you are running from local/not on GCP you can supply credentials in the config for connecting to your GCP
var config ={
appenders:{
google:{
type: 'log4js-stackdriver-appender',
credentials:{
projectId: 'your-project-id',
keyFilename: '/path/to/key.json'
}
}
}
}
npm install log4js-stackdriver-appender --save
FAQs
a log4js appender to use with google cloude logging stackdriver api
The npm package log4js-stackdriver-appender receives a total of 14 weekly downloads. As such, log4js-stackdriver-appender popularity was classified as not popular.
We found that log4js-stackdriver-appender 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.