Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adobe/aio-lib-core-logging

Package Overview
Dependencies
Maintainers
50
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/aio-lib-core-logging

AIO SDK Logging

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
57K
increased by5.49%
Maintainers
50
Weekly downloads
 
Created
Source

aio-lib-core-logging

Usage

let aioLogger = require('aio-lib-core-logging')('App')
aioLogger.info('Hello logs')

Output

Above code will log the following

[App /mynamespace/myaction] info: Hello logs

Where App would be the name of the application/module that is sending the logs.

Configuration

The logger can be customized by passing a config object at the time of creation.

let aioLogger = require('aio-lib-core-logging')('App', config)

The config object can have one or more of the following keys.

  • provider (logging provider. default is winston.)
  • logSourceAction (boolean to control whether to include the action name in the log message)
  • transports (array of custom winston transports)

Using Custom Logger

// Winston Logger
let aioLogger = require('aio-lib-core-logging')('App', {provider:'./WinstonLogger'})
aioLogger.info('Hello logs')

or

// Debug Logger
let aioLogger = require('aio-lib-core-logging')('App', {provider:'./DebugLogger'})

Sending logs to a file

let aioLogger = require('aio-lib-core-logging')('App', {transports: './logfile.txt' })

Using custom winston transports

const winston = require('winston')
let aioLogger = require('aio-lib-core-logging')('App', {transports: [new winston.transports.File({ filename: './winstoncustomfilelog.txt' })]})

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

FAQs

Package last updated on 24 Sep 2019

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