{"_id":"@cabysis/candy-logger","_rev":"14-924fc871c63e66c8faaa267e59d0a176","name":"@cabysis/candy-logger","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.6":{"name":"@cabysis/candy-logger","version":"1.0.6","keywords":["ts","typescript","logger","s3"],"author":{"name":"CabySis"},"license":"MIT","_id":"@cabysis/candy-logger@1.0.6","maintainers":[{"name":"dev-cabysis","email":"dev@cabysis.com"}],"homepage":"https://github.com/cabysis/candy-logger#readme","bugs":{"url":"https://github.com/cabysis/candy-logger/issues"},"dist":{"shasum":"973293d98e9b366534996d7c065e2eab0b47cf30","tarball":"https://registry.npmjs.org/@cabysis/candy-logger/-/candy-logger-1.0.6.tgz","fileCount":24,"integrity":"sha512-euyvI87ZUoXeux2PgDH4HesX9DalO7VZTUJEeCPj8FqfC4vUCKqhIJZRzsXsYpXSpXdaoJYYEr5BvVlh7aY0Xg==","signatures":[{"sig":"MEQCIE1zmqaV0lDRmwa+xz3DymAdlEHVWCUG1e0ZDDuZhONIAiA7LcEn8A9zVWBYEai3cJiyDY7gt/NV8rozc/MDGi6hAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21321},"main":"dist/logger/index.js","types":"dist/logger/index.d.ts","gitHead":"87c702eba6d0b51ddd46adf6d48219c657759136","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"dev-cabysis","email":"dev@cabysis.com"},"repository":{"url":"git+https://github.com/cabysis/candy-logger.git","type":"git"},"_npmVersion":"10.8.2","description":"Logger service with AWS S3 integration for storing logs","directories":{},"_nodeVersion":"22.5.1","dependencies":{"winston":"^3.13.1","@aws-sdk/client-s3":"^3.620.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.2","winston":"3.13.1","prettier":"^3.3.3","typescript":"^5.5.3","@types/jest":"^29.5.12","@types/node":"^16.9.1","@types/express":"^4.17.13","@aws-sdk/client-s3":"3.620.1"},"_npmOperationalInternal":{"tmp":"tmp/candy-logger_1.0.6_1722393158824_0.06445328585431342","host":"s3://npm-registry-packages"}},"1.0.7":{"name":"@cabysis/candy-logger","version":"1.0.7","keywords":["ts","typescript","logger","s3"],"author":{"name":"CabySis"},"license":"MIT","_id":"@cabysis/candy-logger@1.0.7","maintainers":[{"name":"dev-cabysis","email":"dev@cabysis.com"}],"homepage":"https://github.com/cabysis/candy-logger#readme","bugs":{"url":"https://github.com/cabysis/candy-logger/issues"},"dist":{"shasum":"f9e1f6aa567298b40aa8cdb65bd549384a6d1283","tarball":"https://registry.npmjs.org/@cabysis/candy-logger/-/candy-logger-1.0.7.tgz","fileCount":24,"integrity":"sha512-w2xlnmq5cPY37xpwkHW0V2QeGN5HNG950C2lxPjOTqUfLzBmYyvFZnlIWse9Zgt5YYTF/o3shEORUPB2JD95NA==","signatures":[{"sig":"MEUCID1dHoYx+L+ggVi9JiQF1bynySk9nHWL8zHuGoTy1quuAiEA+UwfqhUFcZLr8MtVa5rzQz7ReVnZilU6DA9KyQQbPEg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21321},"main":"dist/logger/index.js","types":"dist/logger/index.d.ts","gitHead":"2195fa7edfbb788bd2753bc34ebbbb0774f60b65","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"dev-cabysis","email":"dev@cabysis.com"},"repository":{"url":"git+https://github.com/cabysis/candy-logger.git","type":"git"},"_npmVersion":"10.5.0","description":"Logger service with AWS S3 integration for storing logs","directories":{},"_nodeVersion":"21.7.3","dependencies":{"winston":"^3.13.1","@aws-sdk/client-s3":"^3.620.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.2","winston":"3.13.1","prettier":"^3.3.3","typescript":"^5.5.3","@types/jest":"^29.5.12","@types/node":"^16.9.1","@types/express":"^4.17.13","@aws-sdk/client-s3":"3.620.1"},"_npmOperationalInternal":{"tmp":"tmp/candy-logger_1.0.7_1722441633410_0.9972343599082711","host":"s3://npm-registry-packages"}},"1.0.8":{"name":"@cabysis/candy-logger","version":"1.0.8","keywords":["ts","typescript","logger","s3"],"author":{"name":"CabySis"},"license":"MIT","_id":"@cabysis/candy-logger@1.0.8","maintainers":[{"name":"dev-cabysis","email":"dev@cabysis.com"}],"homepage":"https://github.com/cabysis/candy-logger#readme","bugs":{"url":"https://github.com/cabysis/candy-logger/issues"},"dist":{"shasum":"23745fb44c80c1e94722a7029c406e2381b38a0a","tarball":"https://registry.npmjs.org/@cabysis/candy-logger/-/candy-logger-1.0.8.tgz","fileCount":24,"integrity":"sha512-2UuZCYn4Ogwp+S/X+spK3Ew9ZTdAgjKErKrxBgaT0oWwyQ/eHCvcpzLdyTAR1+D1p1ECNZxCLMFlV2FFM/KUVw==","signatures":[{"sig":"MEUCIC86a0LR62cgVgplf6rbqf2QFYsg6gECkGQR9w4wujlJAiEA4Zd+0MUAVFVmomnpy56S6DLJx8bmiatnlqjE+s3YhXY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21292},"main":"dist/logger/index.js","types":"dist/logger/index.d.ts","gitHead":"5f8a2eea1763d339f8a7219e80caf3c6ee14cd39","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"dev-cabysis","email":"dev@cabysis.com"},"repository":{"url":"git+https://github.com/cabysis/candy-logger.git","type":"git"},"_npmVersion":"10.5.0","description":"Logger service with AWS S3 integration for storing logs","directories":{},"_nodeVersion":"21.7.3","dependencies":{"winston":"^3.13.1","@aws-sdk/client-s3":"^3.620.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.2","winston":"3.13.1","prettier":"^3.3.3","typescript":"^5.5.3","@types/jest":"^29.5.12","@types/node":"^16.9.1","@types/express":"^4.17.13","@aws-sdk/client-s3":"3.620.1"},"_npmOperationalInternal":{"tmp":"tmp/candy-logger_1.0.8_1722964602196_0.43830701452567156","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-07-30T23:25:58.548Z","modified":"2024-12-13T18:13:36.389Z","1.0.1":"2024-07-29T23:32:48.959Z","1.0.2":"2024-07-30T00:48:37.881Z","1.0.0":"2024-07-30T02:08:39.670Z","1.0.3":"2024-07-30T02:23:01.505Z","1.0.5":"2024-07-30T23:25:58.859Z","1.0.6":"2024-07-31T02:32:38.992Z","1.0.7":"2024-07-31T16:00:33.567Z","1.0.8":"2024-08-06T17:16:42.366Z"},"bugs":{"url":"https://github.com/cabysis/candy-logger/issues"},"author":{"name":"CabySis"},"license":"MIT","homepage":"https://github.com/cabysis/candy-logger#readme","keywords":["ts","typescript","logger","s3"],"repository":{"url":"git+https://github.com/cabysis/candy-logger.git","type":"git"},"description":"Logger service with AWS S3 integration for storing logs","maintainers":[{"email":"dev@cabysis.com","name":"dev-cabysis"},{"email":"arturo.garcia@cabysis.com","name":"arturotphx"}],"readme":"# `@cabysis/candy-logger`\n\n`@cabysis/candy-logger` is a TypeScript library developed by CabySis designed to facilitate the creation and storage of logs in Amazon S3.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Basic Usage](#basic-usage)\n- [Configuration](#configuration)\n- [Examples](#examples)\n- [License](#license)\n\n## Features\n\n- **Log Levels**: Supports multiple log levels, including `info`, `warn`, `error`, `debug`, and `http`.\n- **AWS S3 Storage**: Allows you to save logs in a previously configured S3 bucket.\n- **Application Organization**: Each logger instance can be identified by an application name, facilitating organization and log analysis in environments with multiple applications.\n\n## Installation\n\nTo install `@cabysis/candy-logger`, you can use npm:\n\n```bash\nnpm install @cabysis/candy-logger\n```\n\n## Basic Usage\n\n### Import the Library\n\n```typescript\nimport { createLogger, LoggerConfig } from '@cabysis/candy-logger';\n```\n\n### Logger Configuration\n\nCreate a logger instance by configuring the necessary parameters:\n\n```typescript\nconst loggerConfig: LoggerConfig = {\n  awsRegion: 'your-aws-region',   // AWS region where the S3 bucket is located\n  awsBucket: 'your-s3-bucket',     // Name of the S3 bucket\n  logLevel: 'your-default-level',  // Default log level\n  serviceName: 'your-app-name',    // Application name to identify the logs\n  credentials: AwsCredentialIdentity | Provider<AwsCredentialIdentity> // AWS credentials object\n};\n```\n\nCreate the logger instance with the configuration:\n\n```typescript\nconst logger = createLogger(loggerConfig);\n```\n\n### Logging Messages\n\nUse the logger to record messages at different levels:\n\n```typescript\nlogger.info('This is an informational message');\nlogger.warn('This is a warning message');\nlogger.error('This is an error message');    // Has a second optional parameter: stacktrace\nlogger.debug('This is a debug message');\nlogger.http('This is an HTTP message');\n```\n\n## Examples\n\n### Complete Example\n\nHere’s a complete example of how to use `@cabysis/candy-logger` in an application:\n\n```typescript\nimport { createLogger, LoggerConfig } from '@cabysis/candy-logger';\n\nconst loggerConfig: LoggerConfig = {\n  awsRegion: 'us-east-2',\n  awsBucket: 'my-bucket',\n  logLevel: 'info',\n  serviceName: 'my-app',\n  credentials: fromSSO({ profile: ENV_SSO_PROFILE })    // Configuration for AWS SSO profiles\n};\n\nconst logger = createLogger(loggerConfig);\n\nlogger.info('This is an informational message');\nlogger.warn('This is a warning message');\nlogger.debug('This is a debug message');\nlogger.http('This is an HTTP message');\nlogger.error('This is an error message'); \nlogger.error('An error occurred', 'Error stack trace');\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.","readmeFilename":"README.md"}