Initial LisgloSIPS V2 implementation

This commit is contained in:
hectorzhao
2026-06-22 10:56:38 +08:00
commit 5fa1bd35e9
303 changed files with 35644 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
{
"name": "@lisglosips/observability",
"version": "0.2.0",
"private": true,
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc -p tsconfig.json"
},
"dependencies": {
"pino": "9.14.0"
}
}
+29
View File
@@ -0,0 +1,29 @@
import pino, { type Logger, type LoggerOptions } from 'pino';
export const LOG_REDACT_PATHS = [
'req.headers.authorization',
'req.headers.cookie',
'res.headers["set-cookie"]',
'*.password',
'*.sipPassword',
'*.sipHa1',
'*.token',
'*.refreshToken'
];
export function createLogger(service: string, level = 'info'): Logger {
const options: LoggerOptions = {
name: service,
level,
redact: {
paths: LOG_REDACT_PATHS,
censor: '[REDACTED]'
},
base: {
service
},
timestamp: pino.stdTimeFunctions.isoTime
};
return pino(options);
}
+10
View File
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo"
},
"include": ["src/**/*.ts"]
}