![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@epsor/logger
Advanced tools
Epsor logging superset over Winston for console and elasticsearch
@epsor/logger
This is the custom logger package for Epsor. Use it as soon as you need some logs.
@epsor/logger
assumes that a few environment variables are set:
ELASTICSEARCH_URL
, ELASTICSEARCH_USER
and ELASTICSEARCH_PASSWORD
to identify against Elasticsearch node,SERVICE_NAME
to identify which part of the app sent the logENVIRONMENT
SENTRY_DSN
the Sentry's data source name to push error logs to Sentryimport logger from '@epsor/logger';
logger.info('Hello World!');
Logs are pushed:
Logger uses the npm logging levels, prioritized from 0 to 5 :
{
error: 0,
warn: 1,
info: 2,
verbose: 3,
debug: 4,
silly: 5
}
All log levels are logged to your console, but only log levels info or less are pushed to Elasticsearch, and only error logs are pushed to Sentry. It allows developer to add logs for local debug purpose only.
For optimal readability of logs:
To add metadata in your logs, use an object as the second argument:
logger.info(
'Thats a nice message!',
{
user: {
email: 'julien.murgey@epsor.fr',
firstname: 'Julien'
lastname: 'MURGEY'
id: 48,
},
},
)
To be able to easily find in the codebase where log has been done, add tags in metadata that will be searchable in Kibana.
Example of good tags: transactions
, instructions
, profile selection
, deposit
, arbitration
...
try {
//do something
} catch (e) {
logger.error(
'Error happened!'
{
user: {
email: 'julien.murgey@epsor.fr',
firstname: 'Julien'
lastname: 'MURGEY'
id: 48,
},
tags: ['import', 'contribution'],
errorStack: e.stack,
}
);
}
FAQs
Epsor logging superset over Winston for console and elasticsearch
The npm package @epsor/logger receives a total of 0 weekly downloads. As such, @epsor/logger popularity was classified as not popular.
We found that @epsor/logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 24 open source maintainers 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.