http-system-logger 1.0.14 → 1.0.15
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 +1 -0
- package/dist/winston.config.js +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -92,5 +92,6 @@ You can configure the logger using the following environment variables:
|
|
|
92
92
|
| `LOG_FILE_NAME` | `application` | Base name for log files. |
|
|
93
93
|
| `SERVICE_NAME` | `logger` | Default service name included in log metadata. |
|
|
94
94
|
| `IGNORED_ROUTES` | `/api/health` | Comma-separated list of routes to ignore. |
|
|
95
|
+
| `LOG_LEVEL` | `http` | Log level for the logger. |
|
|
95
96
|
|
|
96
97
|
|
package/dist/winston.config.js
CHANGED
|
@@ -32,9 +32,10 @@ const createLoggerInstance = () => {
|
|
|
32
32
|
const maxSize = process.env.LOG_MAX_SIZE || '4m';
|
|
33
33
|
const maxFiles = process.env.LOG_MAX_FILES || '7d';
|
|
34
34
|
const fileName = process.env.LOG_FILE_NAME || 'application';
|
|
35
|
+
const logLevel = process.env.LOG_LEVEL || 'http';
|
|
35
36
|
const transports = [
|
|
36
37
|
new winston.transports.Console({
|
|
37
|
-
level:
|
|
38
|
+
level: logLevel,
|
|
38
39
|
format: winston.format.combine(winston.format.timestamp({ format: 'YYYY-MM-DD hh:mm:ss A' }), winston.format.colorize(), winston.format.printf(({ timestamp, level, message, context, trace, service, stack }) => {
|
|
39
40
|
return `[\x1b[34m${timestamp}\x1b[0m] [\x1b[36m${service}\x1b[0m] [\x1b[33m${context}\x1b[0m] [${level}]: ${message}${stack ? `\n${stack}` : ''}${trace ? `\n${trace}` : ''}`;
|
|
40
41
|
})),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "http-system-logger",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "A lightweight and configurable logging library for Node.js applications, built with winston and morgan.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"winston-daily-rotate-file": "^5.0.0",
|
|
48
48
|
"winston-transport": "^4.7.0"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|