ZaneRay Express Logging
Structured logging in all environments
Definitions
Environments
Log Levels
- 0: error
- 1: warn
- 2: info
- 3: verbose
- 4: debug
- 5: silly
Nice logging output to defined output destinations
Usage
// in your code.js
const Logging = require("@zaneray/express-logging");
// pass the environment in the constructor
// for 'prod', the stackdriver logger will be added to the target output destination
const logging = new Logging("test");
//pass the logging level in the getLogger method
const logger = logging.getLogger("error");
// Writes some log entries
logger.error("warp nacelles offline");
logger.info("shields at 99%");
API
POST /addPledge
- request.body={"email": "jonkofal@zaneray.com","bags": 5,"ipaddress": "66.135.64.2","location": {"_latitude": 47, "_longitude": 320 }}
- responses
- 200 - irrelevant
- 500 - invalid data, nasty HTML error
GET /coordinates
- responses
- 200 - [ {"_longitude": 320,"_latitude": 47}, {"_latitude": 33,"_longitude": 220}]
GET /bagCount