Guest User

Untitled

a guest
Jun 19th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. import winston from 'winston';
  2. import CloudWatchTransport from 'winston-aws-cloudwatch';
  3.  
  4. const logger = winston.createLogger();
  5. logger.add(new CloudWatchTransport({logGroupName:'my-api', logStreamName: 'lstream'}));
  6. logger.level = 'silly';
  7.  
  8. export default logger;
  9.  
  10. {
  11. "compilerOptions": {
  12. "target": "es2017" ,
  13. "module": "commonjs" ,
  14. "lib": [
  15. "es2017",
  16. "esnext.asynciterable"
  17. ] ,
  18. "allowJs": true ,
  19. "sourceMap": true ,
  20. "outDir": "./dist" ,
  21. "noUnusedLocals": true ,
  22. "noUnusedParameters": true ,
  23. "noImplicitReturns": true ,
  24. "noFallthroughCasesInSwitch": true ,
  25. "moduleResolution": "node" ,
  26. "baseUrl": "./" ,
  27. "paths": {
  28. "*": ["node_modules/*", "src/types/*"]
  29. } ,
  30. "allowSyntheticDefaultImports": true ,
  31. "esModuleInterop": true
  32. }
  33. }
  34.  
  35. {
  36. "name": "winston-aws",
  37. "version": "1.0.0",
  38. "description": "",
  39. "main": "index.js",
  40. "scripts": {
  41. "test": "echo "Error: no test specified" && exit 1",
  42. "start": "ts-node index.js",
  43. "watch-node": "nodemon dist/index.js",
  44. "watch": "concurrently -k -p "[{name}]" -n "TypeScript,Node" -c "yellow.bold,cyan.bold" "npm run watch-ts" "npm run watch-node"",
  45. "watch-test": "npm run test -- --watchAll",
  46. "build-ts": "tsc",
  47. "watch-ts": "tsc --traceResolution -w"
  48. },
  49. "keywords": [],
  50. "author": "",
  51. "license": "ISC",
  52. "dependencies": {
  53. "babel-cli": "^6.26.0",
  54. "winston": "^3.0.0",
  55. "winston-aws-cloudwatch": "^2.0.0"
  56. },
  57. "devDependencies": {
  58. "@types/node": "^10.3.3",
  59. "babel-preset-env": "^1.7.0",
  60. "concurrently": "^3.5.1",
  61. "nodemon": "^1.17.5",
  62. "ts-node": "^6.1.1",
  63. "typescript": "^2.9.2"
  64. }
  65. }
  66.  
  67. [Node] internal/modules/cjs/loader.js:596
  68. [Node] throw err;
  69. [Node] ^
  70. [Node]
  71. [Node] Error: Cannot find module './lib/'
  72. [Node] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
  73. [Node] at Function.Module._load (internal/modules/cjs/loader.js:520:25)
  74. [Node] at Module.require (internal/modules/cjs/loader.js:650:17)
  75. [Node] at require (internal/modules/cjs/helpers.js:20:18)
  76. [Node] at Object.<anonymous> (/Users/nishant/dev/sscce/dist/node_modules/winston-aws-cloudwatch/index.js:1:80)
  77. [Node] at Module._compile (internal/modules/cjs/loader.js:702:30)
  78. [Node] at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
  79. [Node] at Module.load (internal/modules/cjs/loader.js:612:32)
  80. [Node] at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
  81. [Node] at Function.Module._load (internal/modules/cjs/loader.js:543:3)
  82.  
  83. [TypeScript] ======== Module name './lib/' was successfully resolved to '/Users/nishant/dev/sscce/node_modules/winston-aws-cloudwatch/lib/index.js'. ========
Add Comment
Please, Sign In to add comment