
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@sinet/logger
Advanced tools
Winston logger to use with the Logstash and Kibana.
npm install @sinet/logger --save
// Options are for winston transports, file and console
var options = {
'file' : {
// File transport is enabled on development and production environment
'enabled' : [ 'development', 'production' ],
'filename' : 'logs/myLogFile.log',
},
'console' : {
// Console transport is enabled only in development environment
'enabled' : [ 'development' ],
'level' : 'debug'
},
'logstash' : {
'enabled' : [ 'production' ],
'port' : 9563
},
// These are additional fields that get added to all logs
'additional' : {
'container' : 'user-service',
// The items below are defaults added by the library automatically
'hostname' : os.hostname(),
'dockerhost' : process.env.DOCKER_HOST || 'undefined'
}
};
var logger = require( '@sinet/logger' )( options );
logger.error( 'error message', { 'method': 'v1.users.get', 'payload', payload } );
file
or console
option without setting the enabled
property?// Example
var options = {
'file' : {},
'console' : {}
}
Answer:
If file
and/or console
is explicitly provided without setting the enabled property it will log in any environment.
All pull requests must follow coding conventions and standards.
FAQs
Default logger setup using Winston
The npm package @sinet/logger receives a total of 2 weekly downloads. As such, @sinet/logger popularity was classified as not popular.
We found that @sinet/logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.