@mimik/sumologic-winston-logger 1.6.17 → 1.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,13 +36,17 @@ module.exports = class AwsKinesis extends Transport {
36
36
  this.streamNameInfo = options.streamNameInfo;
37
37
  this.streamNameError = options.streamNameError;
38
38
  this.streamNameOther = options.streamNameOther;
39
- this.kinesis = new KinesisClient({
39
+ this.kinesisClientConfig = {
40
40
  region: options.region,
41
- credentials: {
41
+ };
42
+ if (options.accessKeyId && options.secretAccessKey) {
43
+ this.kinesisClientConfig.credentials = {
42
44
  accessKeyId: options.accessKeyId,
43
45
  secretAccessKey: options.secretAccessKey,
44
- },
45
- });
46
+ };
47
+ }
48
+ this.kinesis = new KinesisClient(this.kinesisClientConfig);
49
+
46
50
  this.time = setInterval(() => {
47
51
  Object.keys(events).forEach((level) => {
48
52
  if (events[level].Records.length) {
@@ -122,7 +126,7 @@ module.exports = class AwsKinesis extends Transport {
122
126
  levelData = events[level];
123
127
  }
124
128
  levelData.size += infoSize;
125
- levelData.Records.push({ Data: JSON.stringify(data), PartitionKey: `${PARTITION_KEY}-${randomInt(0, RANDOM_LIMIT)}` });
129
+ levelData.Records.push({ Data: Buffer.from(JSON.stringify(data)), PartitionKey: `${PARTITION_KEY}-${randomInt(0, RANDOM_LIMIT)}` });
126
130
  if (levelData.Records.length >= this.maxEvents || levelData.size >= this.maxSize) {
127
131
  this.send(levelData.Records, level);
128
132
  levelData.Records = [];
@@ -26,13 +26,17 @@ module.exports = class AwsS3 extends Transport {
26
26
  this.maxEvents = options.maxEvents;
27
27
  this.timeInterval = 1000 * 60 * options.timeout; // in minutes
28
28
  this.bucketname = options.bucketname;
29
- this.s3 = new S3Client({
29
+ this.s3ClientConfig = {
30
30
  region: options.region,
31
- credentials: {
31
+ };
32
+ if (options.accessKeyId && options.secretAccessKey) {
33
+ this.kinesisClientConfig.credentials = {
32
34
  accessKeyId: options.accessKeyId,
33
35
  secretAccessKey: options.secretAccessKey,
34
- },
35
- });
36
+ };
37
+ }
38
+ this.s3 = new S3Client(this.s3ClientConfig);
39
+
36
40
  this.time = setInterval(() => {
37
41
  Object.keys(events).forEach((level) => {
38
42
  if (events[level].data.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mimik/sumologic-winston-logger",
3
- "version": "1.6.17",
3
+ "version": "1.6.19",
4
4
  "description": "Log wrapper for sumo, s3, kinesis and winston",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@mimik/lib-filters": "^1.4.8",
37
- "@aws-sdk/client-s3": "3.388.0",
38
- "@aws-sdk/client-kinesis": "3.388.0",
37
+ "@aws-sdk/client-s3": "3.391.0",
38
+ "@aws-sdk/client-kinesis": "3.391.0",
39
39
  "axios": "1.4.0",
40
40
  "bluebird": "3.7.2",
41
41
  "lodash.difference": "4.5.0",
@@ -54,7 +54,7 @@
54
54
  "devDependencies": {
55
55
  "@mimik/eslint-plugin-dependencies": "^2.4.5",
56
56
  "@mimik/eslint-plugin-document-env": "^1.0.5",
57
- "@mimik/request-helper": "^1.7.8",
57
+ "@mimik/request-helper": "^1.7.9",
58
58
  "body-parser": "1.20.2",
59
59
  "chai": "4.3.7",
60
60
  "eslint": "8.47.0",