{"_id":"@chargeuk/log4js-appender-cloudwatch","_rev":"2-eff1a864b58f9d3a28eacbfb6b290628","name":"@chargeuk/log4js-appender-cloudwatch","dist-tags":{"latest":"0.5.2"},"versions":{"0.5.0":{"name":"@chargeuk/log4js-appender-cloudwatch","version":"0.5.0","keywords":["logging","log","log4js","log4js-node","appender","node","cloudwatch","aws"],"author":{"name":"Filip Seman","email":"filip.seman@pm.me"},"license":"Apache-2.0","_id":"@chargeuk/log4js-appender-cloudwatch@0.5.0","maintainers":[{"name":"chargeuk","email":"charge.uk@outlook.com"}],"homepage":"https://github.com/Chargeuk/log4js-appender-cloudwatch#readme","bugs":{"url":"https://github.com/Chargeuk/log4js-appender-cloudwatch/issues"},"dist":{"shasum":"6937b8a6f57e6fc4e4cb779dfb97c5505e8a57b5","tarball":"https://registry.npmjs.org/@chargeuk/log4js-appender-cloudwatch/-/log4js-appender-cloudwatch-0.5.0.tgz","fileCount":5,"integrity":"sha512-/PMCa/+u/WKIGkKzWLC4tPHCUUNNHeVgyfKGPnSGcTu+K/IoQGwd5+nKIeElyJ5D5ps6bgK63TRqnZmLMaDLSQ==","signatures":[{"sig":"MEUCIQCq0j20u6RqZtJejZ7ncLFtLggRdmfyQDNssUU9tRU0ygIgZObSv+JhLAvDwNcuqc/6RyJrdpX3lVGC+bt2+lYuABk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24104},"types":"./dist/index.d.ts","engines":{"node":">=18.18"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"funding":"https://github.com/sponsors/xseman","gitHead":"9b21a06c6fbc3a821daf94bd31522a5832e9529b","scripts":{"fmt":"dprint fmt","test":"node --test --test-reporter=spec --env-file=.env --loader=ts-node/esm index.test.mts","build":"tsc","pretest":"tsc","fmt:check":"dprint check","test:watch":"node --test --test-reporter=spec --watch --env-file=.env --loader=ts-node/esm index.test.mts"},"_npmUser":{"name":"chargeuk","email":"charge.uk@outlook.com"},"repository":{"url":"git+https://github.com/Chargeuk/log4js-appender-cloudwatch.git","type":"git"},"_npmVersion":"10.7.0","description":"Log4js cloudwatch appender","directories":{},"_nodeVersion":"20.15.1","dependencies":{"log4js-layout-json":"^0.2.0","@aws-sdk/client-cloudwatch-logs":"~3.577.0"},"_hasShrinkwrap":false,"devDependencies":{"dprint":"^0.47.0","ts-node":"~10.9.0","typescript":"^5.6.0","@types/node":"^22.7.0","@smithy/config-resolver":"~3.0.0"},"peerDependencies":{"log4js":">=6"},"_npmOperationalInternal":{"tmp":"tmp/log4js-appender-cloudwatch_0.5.0_1734263869076_0.3085285154664874","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@chargeuk/log4js-appender-cloudwatch","version":"0.5.1","keywords":["logging","log","log4js","log4js-node","appender","node","cloudwatch","aws"],"author":{"name":"Filip Seman","email":"filip.seman@pm.me"},"license":"Apache-2.0","_id":"@chargeuk/log4js-appender-cloudwatch@0.5.1","maintainers":[{"name":"chargeuk","email":"charge.uk@outlook.com"}],"homepage":"https://github.com/Chargeuk/log4js-appender-cloudwatch#readme","bugs":{"url":"https://github.com/Chargeuk/log4js-appender-cloudwatch/issues"},"dist":{"shasum":"bcbc3aa532a13a05c1eaf32c9f31e711a35cbf81","tarball":"https://registry.npmjs.org/@chargeuk/log4js-appender-cloudwatch/-/log4js-appender-cloudwatch-0.5.1.tgz","fileCount":5,"integrity":"sha512-9WNlprr8minVVwLubox77dT+1rWMjEwTD+NcWUlHvI78JEe2T+T9J9IhRrXFBQvp4rB57ZFk7q1VvmAKYIY37Q==","signatures":[{"sig":"MEQCIBQbIfxTsswkpmqdbYxaEwZTkZAdQBg6uGopPxcaEaX1AiBeznaX0C0K+4VsqM7yFy6aA6vKkuIZDGCMOniUwRPc5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24925},"types":"./dist/index.d.ts","engines":{"node":">=18.18"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"funding":"https://github.com/sponsors/xseman","gitHead":"41a818f8fb7e3304743ff18cc467364701efa391","scripts":{"fmt":"dprint fmt","test":"node --test --test-reporter=spec --env-file=.env --loader=ts-node/esm index.test.mts","build":"tsc","pretest":"tsc","fmt:check":"dprint check","test:watch":"node --test --test-reporter=spec --watch --env-file=.env --loader=ts-node/esm index.test.mts"},"_npmUser":{"name":"chargeuk","email":"charge.uk@outlook.com"},"repository":{"url":"git+https://github.com/Chargeuk/log4js-appender-cloudwatch.git","type":"git"},"_npmVersion":"10.7.0","description":"Log4js cloudwatch appender","directories":{},"_nodeVersion":"20.15.1","dependencies":{"log4js-layout-json":"^0.2.0","@aws-sdk/client-cloudwatch-logs":"~3.577.0"},"_hasShrinkwrap":false,"devDependencies":{"dprint":"^0.47.0","ts-node":"~10.9.0","typescript":"^5.6.0","@types/node":"^22.7.0","@smithy/config-resolver":"~3.0.0"},"peerDependencies":{"log4js":">=6"},"_npmOperationalInternal":{"tmp":"tmp/log4js-appender-cloudwatch_0.5.1_1734274823121_0.5640464943728527","host":"s3://npm-registry-packages-npm-production"}},"0.5.2":{"name":"@chargeuk/log4js-appender-cloudwatch","version":"0.5.2","license":"Apache-2.0","funding":"https://github.com/sponsors/xseman","homepage":"https://github.com/Chargeuk/log4js-appender-cloudwatch#readme","description":"Log4js cloudwatch appender","author":{"name":"Filip Seman","email":"filip.seman@pm.me"},"repository":{"type":"git","url":"git+https://github.com/Chargeuk/log4js-appender-cloudwatch.git"},"keywords":["logging","log","log4js","log4js-node","appender","node","cloudwatch","aws"],"scripts":{"build":"tsc","pretest":"tsc","fmt":"dprint fmt","fmt:check":"dprint check","test":"node --test --test-reporter=spec --env-file=.env --loader=ts-node/esm index.test.mts","test:watch":"node --test --test-reporter=spec --watch --env-file=.env --loader=ts-node/esm index.test.mts"},"dependencies":{"@aws-sdk/client-cloudwatch-logs":"~3.577.0","log4js-layout-json":"^0.2.0"},"devDependencies":{"@smithy/config-resolver":"~3.0.0","@types/node":"^22.7.0","dprint":"^0.47.0","ts-node":"~10.9.0","typescript":"^5.6.0"},"peerDependencies":{"log4js":">=6"},"types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"engines":{"node":">=18.18"},"_id":"@chargeuk/log4js-appender-cloudwatch@0.5.2","gitHead":"41a818f8fb7e3304743ff18cc467364701efa391","bugs":{"url":"https://github.com/Chargeuk/log4js-appender-cloudwatch/issues"},"_nodeVersion":"20.15.1","_npmVersion":"10.7.0","dist":{"integrity":"sha512-j+BZdcVgki0s9zyzaUQwcLNXrW+ivweaOhCgN+EapB8Ixnu6QkeSaylTnnfofT9i1FGbNSAWuN6IpAdVpuGOVg==","shasum":"84650b645ef4c6f94895408f86b922901d0556fa","tarball":"https://registry.npmjs.org/@chargeuk/log4js-appender-cloudwatch/-/log4js-appender-cloudwatch-0.5.2.tgz","fileCount":5,"unpackedSize":25011,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH9K+dTmS8Ps59gOsnLnQZAoa0FH+0LA3Qn93aYc/OJOAiBv8wdBGc7HdlGM5U8gNtWuKRiNSIVgybugUC4yVDsKEw=="}]},"_npmUser":{"name":"chargeuk","email":"charge.uk@outlook.com"},"directories":{},"maintainers":[{"name":"chargeuk","email":"charge.uk@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/log4js-appender-cloudwatch_0.5.2_1734348103258_0.7347039675106801"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-15T11:57:48.992Z","modified":"2024-12-16T11:21:43.587Z","0.5.0":"2024-12-15T11:57:49.245Z","0.5.1":"2024-12-15T15:00:23.282Z","0.5.2":"2024-12-16T11:21:43.433Z"},"bugs":{"url":"https://github.com/Chargeuk/log4js-appender-cloudwatch/issues"},"author":{"name":"Filip Seman","email":"filip.seman@pm.me"},"license":"Apache-2.0","homepage":"https://github.com/Chargeuk/log4js-appender-cloudwatch#readme","keywords":["logging","log","log4js","log4js-node","appender","node","cloudwatch","aws"],"repository":{"type":"git","url":"git+https://github.com/Chargeuk/log4js-appender-cloudwatch.git"},"description":"Log4js cloudwatch appender","maintainers":[{"name":"chargeuk","email":"charge.uk@outlook.com"}],"readme":"# log4js appender - AWS CloudWatch\n\nNote that this project is a fork of the below description. It has been updated to resolve importing into older projects. Everything below this line is taken from the original forked project.\n\nThis module provides a custom appender for [log4js][log4js_github] that\nsends logs to AWS [CloudWatch][aws_cloudwatch] using the AWS [v3 SDK][cloudwatch_sdk].\n\n![visual](docs/visual.svg)\n\n[aws_cloudwatch]: https://aws.amazon.com/cloudwatch/\n[cloudwatch_sdk]: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/\n[log4js_github]: https://log4js-node.github.io/log4js-node/\n\n## Installation\n\n### npm registry\n\n```sh\nnpm install log4js-appender-cloudwatch\n```\n\n## Configuration\n\n### Roles\n\n**Required**\n\n```plain\nlogs:PutLogEvents\n```\n\n**To enable the appender to create a group and log stream in AWS, adition roleare\nrequired.**\n\n```plain\nlogs:PutLogEvents\nlogs:CreateLogGroup\nlogs:CreateLogStream\nlogs:DescribeLogStreams\nlogs:DescribeLogGroups\n```\n\n**Reqired for testing.**\n\nTo run tests, create `.env` with AWS access and secret keys.\n\n```plain\nlogs:PutLogEvents\nlogs:GetLogEvents\n```\n\n```json\n{\n\t\"Version\": \"2012-10-17\",\n\t\"Statement\": [\n\t\t{\n\t\t\t\"Action\": [\n\t\t\t\t\"logs:PutLogEvents\",\n\t\t\t\t\"logs:GetLogEvents\"\n\t\t\t],\n\t\t\t\"Effect\": \"Allow\",\n\t\t\t\"Resource\": \"*\"\n\t\t}\n\t]\n}\n```\n\n### TypeScript\n\nIf you're using TypeScript, importing this library as a side effect will\nautomatically merge the log4js interface `Appenders`. This merging enables\nautocomplete for the appenders configuration, providing convenient access to its\nproperties.\n\n```ts\nimport \"log4js-appender-cloudwatch\";\n```\n\n### Example\n\n```ts\nimport log4js from \"log4js\";\n\nimport \"log4js-appender-cloudwatch\";\n\nlog4js.configure({\n\tappenders: {\n\t\tcloudwatch: {\n\t\t\ttype: \"log4js-appender-cloudwatch\",\n\t\t\taccessKeyId: \"<secret>\",\n\t\t\tsecretAccessKey: \"<secret>\",\n\t\t\tregion: \"<config>\",\n\t\t\tlogGroupName: \"<config>\",\n\t\t\tlogStreamName: \"<config>\",\n\t\t\tbatchSize: 10,\n\t\t\tbufferTimeout: 1000, // in ms\n\t\t},\n\t},\n\tcategories: {\n\t\tdefault: {\n\t\t\tlevel: \"debug\",\n\t\t\tappenders: [\n\t\t\t\t\"cloudwatch\",\n\t\t\t],\n\t\t},\n\t},\n});\n\nconst log = log4js.getLogger();\n// ...\n```\n\n## Options\n\n### type\n\n_Required_\\\nType: `log4js-appender-cloudwatch`\n\nType of appender that's loaded from `node_modules`.\n\n### batchSize\n\n_Required_\\\nType: `number`\n\nMaximum number of log events to include in a single batch when sending. Once the\nbatch size is reached, it will be sent to CloudWatch.\n\n### bufferTimeout\n\n_Required_\\\nType: `number`\n\nMaximum time (in milliseconds) to wait before sending a batch of logs,\nregardless of the batch size. If the timeout is reached before the batch size is\nmet, the logs will be sent.\n\n### logGroupName (aws)\n\n_Required_\\\nType: `string`\n\nThe name of the log group in AWS CloudWatch Logs where your logs are stored.\n\n### logStreamName (aws)\n\n_Required_\\\nType: `string`\n\nThe name of the log stream within the specified log group where your logs are\nstored.\n\n### region (aws)\n\n_Required_\\\nType: `string`\n\nThe AWS region where your log group and log stream are located.\n\n### accessKeyId (aws)\n\n_Required_\\\nType: `string`\n\nYour AWS access key ID for authentication.\n\n### secretAccessKey (aws)\n\n_Required_\\\nType: `string`\n\nYour AWS secret access key for authentication.\n\n### sessionToken (aws)\n\n_Optional_\\\nType: `string`\n\nYour AWS session token for authentication. This is used when you are using temporary security credentials.\n\n## Testing\n\nTo test this library during development, you'll need to provide your AWS\ncredentials. These credentials should be stored securely in a `.env` file\nlocated at the root of your project directory.\n\n```sh\n# .env\nACCESSKEY_ID=\"<key>\"\nSECRET_ACCESS_KEY=\"<key>\"\n```\n\nThen, you're ready to run tests:\n\n```sh\nnpm test\n```\n","readmeFilename":"README.md"}