asynclog
Logging made easy, useful and scalable
Features
- Easy to use
- External transport
- Event tracking
How to use
- Include package in your project
npm install --save asynclog# or, if you are using yarnyarn add asynclog
- Start using
const log = 'myApp'{logloglogloglogevent0 'Category' 'Action' 'Label' 0}
- Enable logging namespace while running program
LOG_NAMESPACE=* node example.js
[Logs Image]
External log providers
- Google Cloud
# Set ENV variables before running projectLOG_TRANSPORT=google-cloudGCLOUD_PROJECT_ID=ivikramtiwari # use your project id
Event Tracking
- Google Analytics
# Set ENV variables before running projectEVENT_TRACKING=google-analyticsGA_TRACKING_ID=UA-20640332-8 # use your tracking id
Environment Variables
ENV Variable | Possible Value | Usage |
---|---|---|
LOG_NAMESPACE | * | see all logs |
myNamespace | log for myNamespace | |
-myNamespace | don't log myNamespace | |
LOG_TRANSPORT | google-cloud |
stream logs to google cloud logging |
GCLOUD_PROJECT_ID | your-project-id | required if google-cloud was selected as LGO_TRANSPORT |
EVENT_TRACKING | google-analytics |
stream event to google analytics |
GA_TRACKING_ID | UA-12345678-9 | required if google-analytics was selected as EVENT_TRACKING |
Credits
👨💻 Vikram Tiwari
Developer:If you found this library helpful, or learned something from it and want to thank me, consider buying me a cup of ☕️.