@mimik/sumologic-winston-logger 2.1.13 → 2.2.0
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.
- package/README.md +68 -14
- package/configuration/config.js +31 -21
- package/index.js +2 -0
- package/lib/awsKinesisTransport.js +5 -4
- package/lib/awsS3Transport.js +2 -2
- package/lib/common.js +7 -2
- package/lib/formatLib.js +28 -2
- package/lib/stackLib.js +5 -9
- package/lib/sumologicTransport.js +4 -3
- package/package.json +13 -12
- package/.claude/settings.local.json +0 -8
- package/.husky/pre-commit +0 -2
- package/.husky/pre-push +0 -2
- package/README_Supplement.md +0 -138
- package/eslint.config.js +0 -70
- package/test/filterConfig.json +0 -5
- package/test/logger.spec.js +0 -600
- package/test/loggerProd.spec.js +0 -84
- package/test/testEnv.js +0 -60
- package/test/testEnvProdFilter.js +0 -30
package/test/testEnv.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/* eslint no-process-env: "off" */
|
|
2
|
-
import process from 'node:process';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* Test logger Configuration.
|
|
7
|
-
*
|
|
8
|
-
* @description The following environment variables are needed to configure logger:
|
|
9
|
-
*
|
|
10
|
-
* | Env variable name | Description | Default | Comments |
|
|
11
|
-
* | ----------------- | ----------- | ------- | -------- |
|
|
12
|
-
* | SERVER_TYPE | type of the server that is logged
|
|
13
|
-
* | SERVER_ID | id of the server that is logged
|
|
14
|
-
* | LOG_LEVEL | log level of the running instance
|
|
15
|
-
* | CONSOLE_LEVEL | log level for the console of the running instance
|
|
16
|
-
* | FLUSH_EXIT_DELAY | delay when exiting gracefully
|
|
17
|
-
* | NO_STACK | indicator to log the stack on all log messages
|
|
18
|
-
* | LOG_MODE | log mode for the running instance
|
|
19
|
-
* | SUMO_LOGIC_ENDPOINT | url of the sumologic collector
|
|
20
|
-
* | SUMO_LOGIC_COLLECTOR_CODE | code of the sumologic collector
|
|
21
|
-
* | KINESIS_AWS_STREAM_NAME_INFO | name of the stream for info level logs
|
|
22
|
-
* | KINESIS_AWS_STREAM_NAME_ERROR | name of the stream for error level logs
|
|
23
|
-
* | KINESIS_AWS_STREAM_NAME_OTHER | name of the stream for any other level logs
|
|
24
|
-
* | KINESIS_AWS_REGION | region of the stream
|
|
25
|
-
* | KINESIS_AWS_TIMEOUT | maximum time before flushing
|
|
26
|
-
* | KINESIS_AWS_MAX_SIZE | maximum size of the accumulated logs before flushing
|
|
27
|
-
* | KINESIS_AWS_MAX_EVENTS | maximum number of accumulated logs before flushing
|
|
28
|
-
* | KINESIS_AWS_ACCESS_KEY_ID | access key id of the stream
|
|
29
|
-
* | KINESIS_AWS_SECRET_ACCESS_KEY | access key secret of the stream
|
|
30
|
-
* | S3_AWS_BUCKET_NAME | name of the bucket for storing the logs
|
|
31
|
-
* | S3_AWS_REGION | region of the bucket
|
|
32
|
-
* | S3_AWS_TIMEOUT | maximum time before flushing
|
|
33
|
-
* | S3_AWS_MAX_SIZE | maximum size of the accumulated logs before flushing
|
|
34
|
-
* | S3_AWS_MAX_EVENTS | maximum number of accumulated logs before flushing
|
|
35
|
-
* | S3_AWS_ACCESS_KEY_ID | access key id of the bucket
|
|
36
|
-
* | S3_AWS_SECRET_ACCESS_KEY | access key secret of the bucket
|
|
37
|
-
*/
|
|
38
|
-
// process.env.SUMO_LOGIC_ENDPOINT = 'http://localhost:9080/logs/';
|
|
39
|
-
// process.env.SUMO_LOGIC_COLLECTOR_CODE = '1234';
|
|
40
|
-
process.env.SUMO_LOGIC_ENDPOINT = 'https://a sumologic endpoint url';
|
|
41
|
-
process.env.SUMO_LOGIC_COLLECTOR_CODE = 'a sumologic collector code';
|
|
42
|
-
// process.env.S3_AWS_ACCESS_KEY_ID = 'a AWS S3 access ID';
|
|
43
|
-
process.env.S3_AWS_REGION = 'a AWS region';
|
|
44
|
-
// process.env.S3_AWS_SECRET_ACCESS_KEY = 'a AWS S3 access key';
|
|
45
|
-
process.env.S3_AWS_BUCKET_NAME = 'a AWS S3 access ID';
|
|
46
|
-
// process.env.KINESIS_AWS_ACCESS_KEY_ID = 'a AWS S3 access ID';
|
|
47
|
-
// process.env.KINESIS_AWS_SECRET_ACCESS_KEY = 'a AWS S3 access key';
|
|
48
|
-
process.env.KINESIS_AWS_REGION = 'a AWS region';
|
|
49
|
-
process.env.KINESIS_AWS_STREAM_NAME_INFO = 'a kinesis stream name for info';
|
|
50
|
-
process.env.KINESIS_AWS_STREAM_NAME_ERROR = 'a kinesis stream name for error';
|
|
51
|
-
process.env.KINESIS_AWS_STREAM_NAME_OTHER = 'a kinesis stream name for other';
|
|
52
|
-
process.env.S3_AWS_MAX_EVENTS = 1;
|
|
53
|
-
process.env.KINESIS_AWS_MAX_EVENTS = 1;
|
|
54
|
-
process.env.FLUSH_EXIT_DELAY = 1;
|
|
55
|
-
process.env.LOG_MODE = 'awsS3, sumologic, awsKinesis';
|
|
56
|
-
process.env.NO_STACK = 'yes';
|
|
57
|
-
process.env.LOG_LEVEL = 'info';
|
|
58
|
-
process.env.CONSOLE_LEVEL = 'debug';
|
|
59
|
-
process.env.SERVER_ID = 'a server Id';
|
|
60
|
-
process.env.SERVER_TYPE = 'mTest';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint no-process-env: "off" */
|
|
2
|
-
import process from 'node:process';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* Test logger prod with filter Configuration.
|
|
7
|
-
*
|
|
8
|
-
* @description The following environment variables are needed to configure logger:
|
|
9
|
-
*
|
|
10
|
-
* | Env variable name | Description | Default | Comments |
|
|
11
|
-
* | ----------------- | ----------- | ------- | -------- |
|
|
12
|
-
* | NODE_ENV | environment of the instance
|
|
13
|
-
* | LOG_LEVEL | log level of the running instance
|
|
14
|
-
* | CONSOLE_LEVEL | log level for the console of the running instance
|
|
15
|
-
* | FILTER_FILE | filename containing filter rules
|
|
16
|
-
* | NO_STACK | indicator to log the stack on all log messages
|
|
17
|
-
* | LOG_MODE | log mode for the running instance
|
|
18
|
-
* | SUMO_LOGIC_ENDPOINT | url of the sumologic collector
|
|
19
|
-
* | SUMO_LOGIC_COLLECTOR_CODE | code of the sumologic collector
|
|
20
|
-
*/
|
|
21
|
-
// process.env.SUMO_LOGIC_ENDPOINT = 'http://localhost:9080/logs/';
|
|
22
|
-
// process.env.SUMO_LOGIC_COLLECTOR_CODE = '1234';
|
|
23
|
-
process.env.SUMO_LOGIC_ENDPOINT = 'https://a sumologic endpoint url';
|
|
24
|
-
process.env.SUMO_LOGIC_COLLECTOR_CODE = 'a sumologic collector code';
|
|
25
|
-
process.env.NODE_ENV = 'prod';
|
|
26
|
-
process.env.FILTER_FILE = './test/filterConfig.json';
|
|
27
|
-
process.env.NO_STACK = 'yes';
|
|
28
|
-
process.env.LOG_MODE = 'none';
|
|
29
|
-
process.env.CONSOLE_LEVEL = 'debug';
|
|
30
|
-
process.env.LOG_LEVEL = 'debug';
|