logixia 1.1.4 → 1.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 +8 -0
- package/dist/{build-DIEB3doa.js → build-DOx-YxF1.js} +1 -1
- package/dist/{build-DIEB3doa.js.map → build-DOx-YxF1.js.map} +1 -1
- package/dist/{build-MmD3T4bV.mjs → build-DWmxA6A2.mjs} +1 -1
- package/dist/{build-MmD3T4bV.mjs.map → build-DWmxA6A2.mjs.map} +1 -1
- package/dist/{esm-BRY8ugtK.mjs → esm-1Ra90uql.mjs} +1 -1
- package/dist/{esm-BRY8ugtK.mjs.map → esm-1Ra90uql.mjs.map} +1 -1
- package/dist/{esm-CzjF801-.js → esm-FNhqFIqG.js} +1 -1
- package/dist/{esm-CzjF801-.js.map → esm-FNhqFIqG.js.map} +1 -1
- package/dist/index-BDRSTjUt.d.ts +247 -0
- package/dist/index-BDRSTjUt.d.ts.map +1 -0
- package/dist/index-Drrzn-Yg.d.mts +247 -0
- package/dist/index-Drrzn-Yg.d.mts.map +1 -0
- package/dist/index.d.mts +4 -1311
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +4 -1311
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +177 -13898
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +135 -13841
- package/dist/index.mjs.map +1 -1
- package/dist/{lib-BNWFXK2z.mjs → lib-8XKCHDOH.mjs} +1 -1
- package/dist/{lib-BNWFXK2z.mjs.map → lib-8XKCHDOH.mjs.map} +1 -1
- package/dist/{lib-Bb_wxP5g.js → lib-BNEYXXTQ.js} +1 -1
- package/dist/{lib-Bb_wxP5g.js.map → lib-BNEYXXTQ.js.map} +1 -1
- package/dist/logitron-logger.module-CY3t8yK6.d.mts +279 -0
- package/dist/logitron-logger.module-CY3t8yK6.d.mts.map +1 -0
- package/dist/logitron-logger.module-DgEldK9V.d.ts +279 -0
- package/dist/logitron-logger.module-DgEldK9V.d.ts.map +1 -0
- package/dist/logitron-logger.module-X6nGDVGC.js +10484 -0
- package/dist/logitron-logger.module-X6nGDVGC.js.map +1 -0
- package/dist/logitron-logger.module-iO8DPE7_.mjs +10307 -0
- package/dist/logitron-logger.module-iO8DPE7_.mjs.map +1 -0
- package/dist/nest.d.mts +63 -0
- package/dist/nest.d.mts.map +1 -0
- package/dist/nest.d.ts +63 -0
- package/dist/nest.d.ts.map +1 -0
- package/dist/nest.js +127 -0
- package/dist/nest.js.map +1 -0
- package/dist/nest.mjs +95 -0
- package/dist/nest.mjs.map +1 -0
- package/dist/{promise-O6_ARWpI.mjs → promise-C4pQPcK4.mjs} +1 -1
- package/dist/{promise-O6_ARWpI.mjs.map → promise-C4pQPcK4.mjs.map} +1 -1
- package/dist/{promise-DWsrbKAX.js → promise-DaiZ2BaH.js} +1 -1
- package/dist/{promise-DWsrbKAX.js.map → promise-DaiZ2BaH.js.map} +1 -1
- package/dist/search-1txemGPh.mjs +1 -0
- package/dist/search-Cg_OasF-.d.ts +1 -0
- package/dist/search-DanSf_yc.d.mts +1 -0
- package/dist/search-DeZHhWxB.js +0 -0
- package/dist/search.d.mts +1 -0
- package/dist/search.d.ts +1 -0
- package/dist/search.js +1 -0
- package/dist/search.mjs +3 -0
- package/dist/{sqlite3-DWYzFy5X.js → sqlite3-CSkpjC90.js} +1 -1
- package/dist/{sqlite3-DWYzFy5X.js.map → sqlite3-CSkpjC90.js.map} +1 -1
- package/dist/{sqlite3-BUpkBlte.mjs → sqlite3-DD2_nRRH.mjs} +1 -1
- package/dist/{sqlite3-BUpkBlte.mjs.map → sqlite3-DD2_nRRH.mjs.map} +1 -1
- package/dist/transport.manager-C3Xr7Tvi.js +1925 -0
- package/dist/transport.manager-C3Xr7Tvi.js.map +1 -0
- package/dist/transport.manager-Vi__pagn.mjs +1849 -0
- package/dist/transport.manager-Vi__pagn.mjs.map +1 -0
- package/dist/transports.d.mts +409 -0
- package/dist/transports.d.mts.map +1 -0
- package/dist/transports.d.ts +409 -0
- package/dist/transports.d.ts.map +1 -0
- package/dist/transports.js +11 -0
- package/dist/transports.mjs +3 -0
- package/package.json +19 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,524 +1,8 @@
|
|
|
1
|
+
import { A as RequestTiming, C as TimingEntry, D as HttpRequest, E as HttpError, O as HttpResponse, S as RequestContext, T as TraceIdExtractorConfig, _ as LogLevelString, a as Environment, b as NamespaceLevels, c as GracefulShutdownConfig, d as ILogger, f as ILoggerDefault, g as LogLevel, h as LogFieldKey, i as DEFAULT_LOG_LEVELS, k as RequestMetrics, l as IBaseLogger, m as LogEntry, n as CustomLevelMethods, o as ErrorSerializationOptions, p as LogColor, r as DEFAULT_LOG_COLORS, s as ExtractLevels, t as ContextData, u as ILogFormatter, v as LoggerConfig, w as TraceIdConfig, x as RedactConfig, y as LoggerWithLevels } from "./index-Drrzn-Yg.mjs";
|
|
2
|
+
import { a as LogixiaOptionsFactory, c as LogixiaLoggerService, i as LogixiaLoggerModule, l as LogixiaLogger, n as LOGIXIA_LOGGER_PREFIX, o as WebSocketTraceInterceptor, r as LogixiaAsyncOptions, s as KafkaTraceInterceptor, t as LOGIXIA_LOGGER_CONFIG, u as createLogger$1 } from "./logitron-logger.module-CY3t8yK6.mjs";
|
|
3
|
+
import "./search-DanSf_yc.mjs";
|
|
1
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
import * as _nestjs_common0 from "@nestjs/common";
|
|
3
|
-
import { CallHandler, ExecutionContext, InjectionToken, LoggerService, MiddlewareConsumer, ModuleMetadata, NestInterceptor, NestModule, OptionalFactoryDependency, Type } from "@nestjs/common";
|
|
4
|
-
import { Observable } from "rxjs";
|
|
5
5
|
|
|
6
|
-
//#region src/types/http.types.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* HTTP-related type definitions for Logitron
|
|
9
|
-
*/
|
|
10
|
-
interface HttpRequest {
|
|
11
|
-
method: string;
|
|
12
|
-
url: string;
|
|
13
|
-
headers: Record<string, string | string[]>;
|
|
14
|
-
query?: Record<string, unknown>;
|
|
15
|
-
params?: Record<string, unknown>;
|
|
16
|
-
body?: unknown;
|
|
17
|
-
ip?: string;
|
|
18
|
-
userAgent?: string;
|
|
19
|
-
timestamp: number;
|
|
20
|
-
}
|
|
21
|
-
interface HttpResponse {
|
|
22
|
-
statusCode: number;
|
|
23
|
-
headers: Record<string, string | string[]>;
|
|
24
|
-
body?: unknown;
|
|
25
|
-
timestamp: number;
|
|
26
|
-
contentLength?: number;
|
|
27
|
-
}
|
|
28
|
-
interface HttpError extends Error {
|
|
29
|
-
statusCode?: number;
|
|
30
|
-
code?: string;
|
|
31
|
-
details?: Record<string, unknown>;
|
|
32
|
-
}
|
|
33
|
-
interface RequestTiming {
|
|
34
|
-
start: number;
|
|
35
|
-
end?: number;
|
|
36
|
-
duration?: number;
|
|
37
|
-
phases?: {
|
|
38
|
-
dns?: number;
|
|
39
|
-
tcp?: number;
|
|
40
|
-
tls?: number;
|
|
41
|
-
request?: number;
|
|
42
|
-
response?: number;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
interface RequestMetrics {
|
|
46
|
-
requestId: string;
|
|
47
|
-
method: string;
|
|
48
|
-
url: string;
|
|
49
|
-
statusCode?: number;
|
|
50
|
-
duration?: number;
|
|
51
|
-
contentLength?: number;
|
|
52
|
-
userAgent?: string;
|
|
53
|
-
ip?: string;
|
|
54
|
-
timestamp: number;
|
|
55
|
-
}
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/types/index.d.ts
|
|
58
|
-
declare const LogLevel: {
|
|
59
|
-
readonly ERROR: "error";
|
|
60
|
-
readonly WARN: "warn";
|
|
61
|
-
readonly INFO: "info";
|
|
62
|
-
readonly DEBUG: "debug";
|
|
63
|
-
readonly TRACE: "trace";
|
|
64
|
-
readonly VERBOSE: "verbose";
|
|
65
|
-
};
|
|
66
|
-
type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
67
|
-
type LogLevelString = LogLevel | (string & {});
|
|
68
|
-
type LogColor = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray' | 'grey' | 'brightRed' | 'brightGreen' | 'brightYellow' | 'brightBlue' | 'brightMagenta' | 'brightCyan' | 'brightWhite';
|
|
69
|
-
type LogFieldKey = 'timestamp' | 'level' | 'appName' | 'service' | 'traceId' | 'message' | 'payload' | 'timeTaken' | 'context' | 'requestId' | 'userId' | 'sessionId' | 'environment';
|
|
70
|
-
type Environment = 'development' | 'production';
|
|
71
|
-
interface TraceIdExtractorConfig {
|
|
72
|
-
header?: string | string[];
|
|
73
|
-
query?: string | string[];
|
|
74
|
-
body?: string | string[];
|
|
75
|
-
params?: string | string[];
|
|
76
|
-
}
|
|
77
|
-
interface TraceIdConfig {
|
|
78
|
-
enabled: boolean;
|
|
79
|
-
generator?: () => string;
|
|
80
|
-
contextKey?: string;
|
|
81
|
-
extractor?: TraceIdExtractorConfig;
|
|
82
|
-
}
|
|
83
|
-
interface RedactConfig {
|
|
84
|
-
/**
|
|
85
|
-
* Dot-notation field paths to redact. Supports `*` (one segment) and `**` (any depth).
|
|
86
|
-
* @example `['req.headers.authorization', '*.password', 'user.creditCard']`
|
|
87
|
-
*/
|
|
88
|
-
paths?: string[];
|
|
89
|
-
/**
|
|
90
|
-
* Regex patterns applied to string values — replaces matches with the censor string.
|
|
91
|
-
* @example `[/Bearer\s+\S+/gi, /sk-[a-z0-9]{32,}/gi]`
|
|
92
|
-
*/
|
|
93
|
-
patterns?: RegExp[];
|
|
94
|
-
/** Replacement value for redacted content. Default: `"[REDACTED]"` */
|
|
95
|
-
censor?: string;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Per-namespace log level overrides.
|
|
99
|
-
* Keys are namespace patterns (dot-separated, `*` wildcard); values are log levels.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```ts
|
|
103
|
-
* namespaceLevels: {
|
|
104
|
-
* 'db.*': 'debug', // all db.* namespaces → DEBUG
|
|
105
|
-
* 'http.*': 'warn', // all http.* → WARN only
|
|
106
|
-
* 'payment': 'trace', // payment namespace → TRACE
|
|
107
|
-
* }
|
|
108
|
-
* ```
|
|
109
|
-
* ENV overrides: `LOGIXIA_LEVEL_DB=debug` maps to namespace `db`.
|
|
110
|
-
*/
|
|
111
|
-
type NamespaceLevels = Record<string, LogLevelString>;
|
|
112
|
-
interface GracefulShutdownConfig {
|
|
113
|
-
/** Auto-register SIGTERM/SIGINT handlers to flush this logger on exit. Default: false */
|
|
114
|
-
enabled: boolean;
|
|
115
|
-
/** Max ms to wait for transports to flush. Default: 5000 */
|
|
116
|
-
timeout?: number;
|
|
117
|
-
/** Signals to listen on. Default: ['SIGTERM', 'SIGINT'] */
|
|
118
|
-
signals?: NodeJS.Signals[];
|
|
119
|
-
}
|
|
120
|
-
interface LoggerConfig<TLevels extends Record<string, number> = Record<string, number>> {
|
|
121
|
-
appName?: string;
|
|
122
|
-
environment?: Environment;
|
|
123
|
-
traceId?: boolean | TraceIdConfig;
|
|
124
|
-
format?: {
|
|
125
|
-
timestamp?: boolean;
|
|
126
|
-
colorize?: boolean;
|
|
127
|
-
json?: boolean;
|
|
128
|
-
};
|
|
129
|
-
silent?: boolean;
|
|
130
|
-
levelOptions?: {
|
|
131
|
-
level?: keyof TLevels | LogLevelString;
|
|
132
|
-
levels?: TLevels;
|
|
133
|
-
colors?: Record<string, LogColor>;
|
|
134
|
-
} | undefined;
|
|
135
|
-
fields?: Partial<Record<LogFieldKey, string | boolean>>;
|
|
136
|
-
/**
|
|
137
|
-
* Built-in log redaction — masks sensitive fields before they reach any transport.
|
|
138
|
-
* @see RedactConfig
|
|
139
|
-
*/
|
|
140
|
-
redact?: RedactConfig;
|
|
141
|
-
/**
|
|
142
|
-
* Per-namespace log level overrides.
|
|
143
|
-
* A child logger's context is used as its namespace for matching.
|
|
144
|
-
* ENV vars `LOGIXIA_LEVEL_<NS>=<level>` also apply.
|
|
145
|
-
*/
|
|
146
|
-
namespaceLevels?: NamespaceLevels;
|
|
147
|
-
/**
|
|
148
|
-
* Automatically register SIGTERM/SIGINT handlers that flush all transports
|
|
149
|
-
* before the process exits — prevents losing the last N seconds of logs on
|
|
150
|
-
* deployments / restarts.
|
|
151
|
-
*/
|
|
152
|
-
gracefulShutdown?: boolean | GracefulShutdownConfig;
|
|
153
|
-
[key: string]: unknown;
|
|
154
|
-
}
|
|
155
|
-
interface IBaseLogger {
|
|
156
|
-
error(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
157
|
-
error(error: Error, data?: Record<string, unknown>): Promise<void>;
|
|
158
|
-
warn(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
159
|
-
info(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
160
|
-
debug(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
161
|
-
trace(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
162
|
-
verbose(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
163
|
-
logLevel(level: string, message: string, data?: Record<string, unknown>): Promise<void>;
|
|
164
|
-
time(label: string): void;
|
|
165
|
-
timeEnd(label: string): Promise<number | undefined>;
|
|
166
|
-
timeAsync<T>(label: string, fn: () => Promise<T>): Promise<T>;
|
|
167
|
-
setLevel(level: LogLevel | string): void;
|
|
168
|
-
getLevel(): string;
|
|
169
|
-
setContext(context: string): void;
|
|
170
|
-
getContext(): string | undefined;
|
|
171
|
-
enableField(fieldName: string): void;
|
|
172
|
-
disableField(fieldName: string): void;
|
|
173
|
-
isFieldEnabled(fieldName: string): boolean;
|
|
174
|
-
getFieldState(): Record<string, boolean>;
|
|
175
|
-
resetFieldState(): void;
|
|
176
|
-
enableTransportLevelPrompting(): void;
|
|
177
|
-
disableTransportLevelPrompting(): void;
|
|
178
|
-
setTransportLevels(transportId: string, levels: string[]): void;
|
|
179
|
-
getTransportLevels(transportId: string): string[] | undefined;
|
|
180
|
-
clearTransportLevelPreferences(): void;
|
|
181
|
-
getAvailableTransports(): string[];
|
|
182
|
-
child(context: string, data?: Record<string, unknown>): ILogger;
|
|
183
|
-
close(): Promise<void>;
|
|
184
|
-
}
|
|
185
|
-
type CustomLevelMethods<T extends Record<string, number>> = { [K in keyof T]: (message: string, data?: Record<string, unknown>) => Promise<void> };
|
|
186
|
-
type ILogger<TLevels extends Record<string, number> = {}> = IBaseLogger & CustomLevelMethods<TLevels>;
|
|
187
|
-
interface ILoggerDefault extends IBaseLogger {}
|
|
188
|
-
type LoggerWithLevels<T extends LoggerConfig<any>> = T['levelOptions'] extends {
|
|
189
|
-
levels: infer L;
|
|
190
|
-
} ? L extends Record<string, number> ? ILogger<L> : ILoggerDefault : ILoggerDefault;
|
|
191
|
-
type ExtractLevels<T> = T extends LoggerConfig<infer L> ? L : Record<string, number>;
|
|
192
|
-
interface LogEntry {
|
|
193
|
-
timestamp: string;
|
|
194
|
-
level: string;
|
|
195
|
-
appName: string;
|
|
196
|
-
environment?: string;
|
|
197
|
-
traceId?: string;
|
|
198
|
-
message: string;
|
|
199
|
-
payload?: Record<string, unknown>;
|
|
200
|
-
context?: string;
|
|
201
|
-
error?: Error;
|
|
202
|
-
}
|
|
203
|
-
interface ErrorSerializationOptions {
|
|
204
|
-
includeStack?: boolean;
|
|
205
|
-
maxDepth?: number;
|
|
206
|
-
excludeFields?: string[];
|
|
207
|
-
}
|
|
208
|
-
interface TimingEntry {
|
|
209
|
-
label: string;
|
|
210
|
-
startTime: number;
|
|
211
|
-
endTime?: number;
|
|
212
|
-
duration?: number;
|
|
213
|
-
}
|
|
214
|
-
interface ContextData {
|
|
215
|
-
[key: string]: unknown;
|
|
216
|
-
}
|
|
217
|
-
interface ILogFormatter {
|
|
218
|
-
format(entry: LogEntry): string;
|
|
219
|
-
}
|
|
220
|
-
interface RequestContext {
|
|
221
|
-
requestId: string;
|
|
222
|
-
traceId?: string;
|
|
223
|
-
startTime: number;
|
|
224
|
-
endTime?: number;
|
|
225
|
-
duration?: number;
|
|
226
|
-
request: HttpRequest;
|
|
227
|
-
response?: HttpResponse;
|
|
228
|
-
error?: Error;
|
|
229
|
-
userId?: string;
|
|
230
|
-
sessionId?: string;
|
|
231
|
-
userAgent?: string;
|
|
232
|
-
ip?: string;
|
|
233
|
-
}
|
|
234
|
-
declare const DEFAULT_LOG_LEVELS: {
|
|
235
|
-
error: number;
|
|
236
|
-
warn: number;
|
|
237
|
-
info: number;
|
|
238
|
-
debug: number;
|
|
239
|
-
trace: number;
|
|
240
|
-
verbose: number;
|
|
241
|
-
};
|
|
242
|
-
declare const DEFAULT_LOG_COLORS: {
|
|
243
|
-
error: string;
|
|
244
|
-
warn: string;
|
|
245
|
-
info: string;
|
|
246
|
-
debug: string;
|
|
247
|
-
trace: string;
|
|
248
|
-
verbose: string;
|
|
249
|
-
};
|
|
250
|
-
//#endregion
|
|
251
|
-
//#region src/core/logitron-logger.d.ts
|
|
252
|
-
declare class LogixiaLogger<TConfig extends LoggerConfig<Record<string, number>> = LoggerConfig> implements ILoggerDefault {
|
|
253
|
-
[K: string]: any;
|
|
254
|
-
private config;
|
|
255
|
-
private context?;
|
|
256
|
-
private timers;
|
|
257
|
-
private contextData;
|
|
258
|
-
private transportManager?;
|
|
259
|
-
private fieldState;
|
|
260
|
-
/** Stable fallback trace ID generated ONCE per logger instance. */
|
|
261
|
-
private readonly fallbackTraceId;
|
|
262
|
-
/** Numeric value for each known log level — built once, read on every log call. */
|
|
263
|
-
private _levelValues;
|
|
264
|
-
/** Numeric threshold for the currently active log level. */
|
|
265
|
-
private _minLevelValue;
|
|
266
|
-
/** Pre-built ANSI color codes to avoid recreating the object in colorize(). */
|
|
267
|
-
private _colorMap;
|
|
268
|
-
/** Pre-computed field-enabled booleans so isFieldEnabled() isn't called per log. */
|
|
269
|
-
private _fieldCache;
|
|
270
|
-
/** True when contextData is non-empty — avoids Object.keys() check on hot path. */
|
|
271
|
-
private _hasContextData;
|
|
272
|
-
/**
|
|
273
|
-
* Pre-computed `[INFO] `, `[WARN] ` etc. strings — avoids a colorize() call per log.
|
|
274
|
-
* Key: lowercase level name. Value: formatted bracket string ready to concatenate.
|
|
275
|
-
*/
|
|
276
|
-
private _formattedLevels;
|
|
277
|
-
/** Pre-computed `[appName] ` string — avoids template literal allocation per log. */
|
|
278
|
-
private _formattedAppName;
|
|
279
|
-
/** True when a redact config is present — short-circuits applyRedaction when false. */
|
|
280
|
-
private _hasRedact;
|
|
281
|
-
constructor(config: TConfig, context?: string);
|
|
282
|
-
private setupGracefulShutdown;
|
|
283
|
-
private createCustomLevelMethods;
|
|
284
|
-
/**
|
|
285
|
-
* Rebuild all hot-path caches after any config mutation or level change.
|
|
286
|
-
* Keeps the actual log() call free of allocations in the common case.
|
|
287
|
-
*/
|
|
288
|
-
private _buildPerfCaches;
|
|
289
|
-
error(messageOrError: string | Error, data?: Record<string, unknown>): Promise<void>;
|
|
290
|
-
warn(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
291
|
-
info(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
292
|
-
debug(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
293
|
-
trace(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
294
|
-
verbose(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
295
|
-
logLevel(level: string, message: string, data?: Record<string, unknown>): Promise<void>;
|
|
296
|
-
time(label: string): void;
|
|
297
|
-
timeEnd(label: string): Promise<number | undefined>;
|
|
298
|
-
timeAsync<T>(label: string, fn: () => Promise<T>): Promise<T>;
|
|
299
|
-
setLevel(level: LogLevelString): void;
|
|
300
|
-
getLevel(): LogLevelString;
|
|
301
|
-
setContext(context: string): void;
|
|
302
|
-
getContext(): string | undefined;
|
|
303
|
-
enableField(fieldName: string): void;
|
|
304
|
-
disableField(fieldName: string): void;
|
|
305
|
-
isFieldEnabled(fieldName: string): boolean;
|
|
306
|
-
getFieldState(): Record<string, boolean>;
|
|
307
|
-
resetFieldState(): void;
|
|
308
|
-
enableTransportLevelPrompting(): void;
|
|
309
|
-
disableTransportLevelPrompting(): void;
|
|
310
|
-
setTransportLevels(transportId: string, levels: string[]): void;
|
|
311
|
-
getTransportLevels(transportId: string): string[] | undefined;
|
|
312
|
-
clearTransportLevelPreferences(): void;
|
|
313
|
-
getAvailableTransports(): string[];
|
|
314
|
-
child(context: string, data?: Record<string, unknown>): ILogger;
|
|
315
|
-
flush(): Promise<void>;
|
|
316
|
-
healthCheck(): Promise<{
|
|
317
|
-
healthy: boolean;
|
|
318
|
-
details: Record<string, unknown>;
|
|
319
|
-
}>;
|
|
320
|
-
close(): Promise<void>;
|
|
321
|
-
private log;
|
|
322
|
-
/**
|
|
323
|
-
* Hot-path level check: a single Map lookup + integer compare.
|
|
324
|
-
* The level map and threshold are pre-built in _buildPerfCaches().
|
|
325
|
-
*/
|
|
326
|
-
private shouldLog;
|
|
327
|
-
/**
|
|
328
|
-
* Feature 3: Resolve the effective log level for this logger instance.
|
|
329
|
-
*
|
|
330
|
-
* Priority:
|
|
331
|
-
* 1. ENV `LOGIXIA_LEVEL_<NS_UPPER>` (e.g. LOGIXIA_LEVEL_DB for ns "db" or "db.queries")
|
|
332
|
-
* 2. Matching `namespaceLevels` config entry (longer pattern = more specific, wins)
|
|
333
|
-
* 3. Global `LOGIXIA_LEVEL` ENV override
|
|
334
|
-
* 4. `levelOptions.level` (resolved via Feature 5 in constructor)
|
|
335
|
-
*/
|
|
336
|
-
private resolveEffectiveLevel;
|
|
337
|
-
private formatLog;
|
|
338
|
-
private colorize;
|
|
339
|
-
private output;
|
|
340
|
-
}
|
|
341
|
-
declare function createLogger$1<T extends LoggerConfig<Record<string, number>>>(config: T, context?: string): LoggerWithLevels<T>;
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region src/core/logitron-nestjs.service.d.ts
|
|
344
|
-
declare class LogixiaLoggerService implements LoggerService {
|
|
345
|
-
private logger;
|
|
346
|
-
private context?;
|
|
347
|
-
constructor(config?: LoggerConfig);
|
|
348
|
-
/**
|
|
349
|
-
* NestJS LoggerService interface implementation
|
|
350
|
-
*/
|
|
351
|
-
log(message: unknown, context?: string): void;
|
|
352
|
-
error(message: unknown, trace?: string, context?: string): void;
|
|
353
|
-
warn(message: unknown, context?: string): void;
|
|
354
|
-
debug(message: unknown, context?: string): void;
|
|
355
|
-
verbose(message: unknown, context?: string): void;
|
|
356
|
-
/**
|
|
357
|
-
* Extended Logitron methods
|
|
358
|
-
*/
|
|
359
|
-
info(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
360
|
-
trace(message: string, data?: Record<string, unknown>): Promise<void>;
|
|
361
|
-
logLevel(level: string, message: string, data?: Record<string, unknown>): Promise<void>;
|
|
362
|
-
/**
|
|
363
|
-
* Timing methods
|
|
364
|
-
*/
|
|
365
|
-
time(label: string): void;
|
|
366
|
-
timeEnd(label: string): Promise<number | undefined>;
|
|
367
|
-
timeAsync<T>(label: string, fn: () => Promise<T>): Promise<T>;
|
|
368
|
-
/**
|
|
369
|
-
* Context and level management
|
|
370
|
-
*/
|
|
371
|
-
setContext(context: string): void;
|
|
372
|
-
getContext(): string | undefined;
|
|
373
|
-
setLevel(level: LogLevelString): void;
|
|
374
|
-
getLevel(): LogLevelString;
|
|
375
|
-
/**
|
|
376
|
-
* Create child logger
|
|
377
|
-
*/
|
|
378
|
-
child(context: string, data?: Record<string, unknown>): LogixiaLoggerService;
|
|
379
|
-
/**
|
|
380
|
-
* Get current trace ID
|
|
381
|
-
*/
|
|
382
|
-
getCurrentTraceId(): string | undefined;
|
|
383
|
-
/**
|
|
384
|
-
* Close logger
|
|
385
|
-
*/
|
|
386
|
-
close(): Promise<void>;
|
|
387
|
-
/**
|
|
388
|
-
* Private helper methods
|
|
389
|
-
*/
|
|
390
|
-
private setContextIfProvided;
|
|
391
|
-
private formatMessage;
|
|
392
|
-
/**
|
|
393
|
-
* Static factory method for easy instantiation
|
|
394
|
-
*/
|
|
395
|
-
static create(config?: LoggerConfig): LogixiaLoggerService;
|
|
396
|
-
/**
|
|
397
|
-
* Get the underlying Logitron logger instance
|
|
398
|
-
*/
|
|
399
|
-
getLogger(): LogixiaLogger;
|
|
400
|
-
}
|
|
401
|
-
//#endregion
|
|
402
|
-
//#region src/core/kafka-trace.interceptor.d.ts
|
|
403
|
-
declare class KafkaTraceInterceptor implements NestInterceptor {
|
|
404
|
-
private readonly config?;
|
|
405
|
-
constructor(config?: TraceIdConfig | undefined);
|
|
406
|
-
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
407
|
-
}
|
|
408
|
-
//#endregion
|
|
409
|
-
//#region src/core/websocket-trace.interceptor.d.ts
|
|
410
|
-
declare class WebSocketTraceInterceptor implements NestInterceptor {
|
|
411
|
-
private readonly config?;
|
|
412
|
-
constructor(config?: TraceIdConfig | undefined);
|
|
413
|
-
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
414
|
-
}
|
|
415
|
-
//#endregion
|
|
416
|
-
//#region src/core/logitron-logger.module.d.ts
|
|
417
|
-
declare const LOGIXIA_LOGGER_CONFIG = "LOGIXIA_LOGGER_CONFIG";
|
|
418
|
-
declare const LOGIXIA_LOGGER_PREFIX = "LOGIXIA_LOGGER_";
|
|
419
|
-
interface LogixiaAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
420
|
-
useExisting?: Type<LogixiaOptionsFactory>;
|
|
421
|
-
useClass?: Type<LogixiaOptionsFactory>;
|
|
422
|
-
useFactory?: (...args: unknown[]) => Promise<Partial<LoggerConfig>> | Partial<LoggerConfig>;
|
|
423
|
-
inject?: Array<InjectionToken | OptionalFactoryDependency>;
|
|
424
|
-
}
|
|
425
|
-
interface LogixiaOptionsFactory {
|
|
426
|
-
createLogixiaOptions(): Promise<Partial<LoggerConfig>> | Partial<LoggerConfig>;
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* Logixia Logger Module for NestJS dependency injection
|
|
430
|
-
*/
|
|
431
|
-
declare class LogixiaLoggerModule implements NestModule {
|
|
432
|
-
private config;
|
|
433
|
-
private static loggerConfig;
|
|
434
|
-
configure(consumer: MiddlewareConsumer): void;
|
|
435
|
-
/**
|
|
436
|
-
* Configure the module with synchronous options
|
|
437
|
-
*/
|
|
438
|
-
static forRoot(config?: Partial<LoggerConfig>): {
|
|
439
|
-
module: typeof LogixiaLoggerModule;
|
|
440
|
-
providers: ({
|
|
441
|
-
provide: string;
|
|
442
|
-
useValue: Partial<LoggerConfig<Record<string, number>>>;
|
|
443
|
-
useFactory?: never;
|
|
444
|
-
inject?: never;
|
|
445
|
-
} | {
|
|
446
|
-
provide: string;
|
|
447
|
-
useValue: TraceIdConfig;
|
|
448
|
-
useFactory?: never;
|
|
449
|
-
inject?: never;
|
|
450
|
-
} | {
|
|
451
|
-
provide: typeof LogixiaLoggerService;
|
|
452
|
-
useFactory: (loggerConfig: Partial<LoggerConfig>) => LogixiaLoggerService;
|
|
453
|
-
inject: string[];
|
|
454
|
-
useValue?: never;
|
|
455
|
-
} | {
|
|
456
|
-
provide: typeof KafkaTraceInterceptor;
|
|
457
|
-
useFactory: (traceConfig: any) => KafkaTraceInterceptor;
|
|
458
|
-
inject: string[];
|
|
459
|
-
useValue?: never;
|
|
460
|
-
} | {
|
|
461
|
-
provide: typeof WebSocketTraceInterceptor;
|
|
462
|
-
useFactory: (traceConfig: any) => WebSocketTraceInterceptor;
|
|
463
|
-
inject: string[];
|
|
464
|
-
useValue?: never;
|
|
465
|
-
})[];
|
|
466
|
-
exports: (string | typeof LogixiaLoggerService | typeof KafkaTraceInterceptor | typeof WebSocketTraceInterceptor)[];
|
|
467
|
-
global: boolean;
|
|
468
|
-
};
|
|
469
|
-
/**
|
|
470
|
-
* Configure the module with asynchronous options
|
|
471
|
-
*/
|
|
472
|
-
static forRootAsync(options: LogixiaAsyncOptions): {
|
|
473
|
-
module: typeof LogixiaLoggerModule;
|
|
474
|
-
imports: (Type<any> | _nestjs_common0.DynamicModule | Promise<_nestjs_common0.DynamicModule> | _nestjs_common0.ForwardReference<any>)[];
|
|
475
|
-
providers: ({
|
|
476
|
-
provide: string;
|
|
477
|
-
useFactory: (...args: unknown[]) => Promise<Partial<LoggerConfig>> | Partial<LoggerConfig>;
|
|
478
|
-
inject: (InjectionToken | OptionalFactoryDependency)[];
|
|
479
|
-
} | {
|
|
480
|
-
provide: string;
|
|
481
|
-
useFactory: (optionsFactory: LogixiaOptionsFactory) => Promise<Partial<LoggerConfig<Record<string, number>>>>;
|
|
482
|
-
inject: Type<LogixiaOptionsFactory>[];
|
|
483
|
-
} | {
|
|
484
|
-
provide: Type<LogixiaOptionsFactory>;
|
|
485
|
-
useClass: Type<LogixiaOptionsFactory>;
|
|
486
|
-
} | {
|
|
487
|
-
provide: string;
|
|
488
|
-
useFactory: (loggerConfig: Partial<LoggerConfig>) => TraceIdConfig;
|
|
489
|
-
inject: string[];
|
|
490
|
-
} | {
|
|
491
|
-
provide: typeof LogixiaLoggerService;
|
|
492
|
-
useFactory: (loggerConfig: Partial<LoggerConfig>) => LogixiaLoggerService;
|
|
493
|
-
inject: string[];
|
|
494
|
-
} | {
|
|
495
|
-
provide: typeof KafkaTraceInterceptor;
|
|
496
|
-
useFactory: (traceConfig: any) => KafkaTraceInterceptor;
|
|
497
|
-
inject: string[];
|
|
498
|
-
} | {
|
|
499
|
-
provide: typeof WebSocketTraceInterceptor;
|
|
500
|
-
useFactory: (traceConfig: any) => WebSocketTraceInterceptor;
|
|
501
|
-
inject: string[];
|
|
502
|
-
})[];
|
|
503
|
-
exports: (string | typeof LogixiaLoggerService | typeof KafkaTraceInterceptor | typeof WebSocketTraceInterceptor)[];
|
|
504
|
-
global: boolean;
|
|
505
|
-
};
|
|
506
|
-
/**
|
|
507
|
-
* Create feature-specific logger instances
|
|
508
|
-
*/
|
|
509
|
-
static forFeature(context: string): {
|
|
510
|
-
module: typeof LogixiaLoggerModule;
|
|
511
|
-
providers: {
|
|
512
|
-
provide: string;
|
|
513
|
-
useFactory: (baseLogger: LogixiaLoggerService) => LogixiaLoggerService;
|
|
514
|
-
inject: (typeof LogixiaLoggerService)[];
|
|
515
|
-
}[];
|
|
516
|
-
exports: string[];
|
|
517
|
-
};
|
|
518
|
-
private static createAsyncProviders;
|
|
519
|
-
private static createAsyncOptionsProvider;
|
|
520
|
-
}
|
|
521
|
-
//#endregion
|
|
522
6
|
//#region src/formatters/json.formatter.d.ts
|
|
523
7
|
declare class JsonFormatter implements ILogFormatter {
|
|
524
8
|
private includeTimestamp;
|
|
@@ -689,797 +173,6 @@ declare const DEFAULT_TRACE_HEADERS: string[];
|
|
|
689
173
|
*/
|
|
690
174
|
declare function createTraceMiddleware(config: TraceIdConfig): (req: unknown, res: unknown, next: () => void) => void;
|
|
691
175
|
//#endregion
|
|
692
|
-
//#region src/search/types/search.types.d.ts
|
|
693
|
-
/**
|
|
694
|
-
* Search filter options
|
|
695
|
-
*/
|
|
696
|
-
interface SearchFilters {
|
|
697
|
-
levels?: string[];
|
|
698
|
-
services?: string[];
|
|
699
|
-
traceIds?: string[];
|
|
700
|
-
timeRange?: TimeRange;
|
|
701
|
-
userIds?: string[];
|
|
702
|
-
sessionIds?: string[];
|
|
703
|
-
contexts?: string[];
|
|
704
|
-
excludePatterns?: string[];
|
|
705
|
-
minSeverity?: number;
|
|
706
|
-
hasError?: boolean;
|
|
707
|
-
customFields?: Record<string, unknown>;
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Time range for filtering logs
|
|
711
|
-
*/
|
|
712
|
-
interface TimeRange {
|
|
713
|
-
start: Date | number;
|
|
714
|
-
end?: Date | number;
|
|
715
|
-
relative?: RelativeTime;
|
|
716
|
-
}
|
|
717
|
-
/**
|
|
718
|
-
* Relative time specification
|
|
719
|
-
*/
|
|
720
|
-
interface RelativeTime {
|
|
721
|
-
value: number;
|
|
722
|
-
unit: 'seconds' | 'minutes' | 'hours' | 'days';
|
|
723
|
-
}
|
|
724
|
-
/**
|
|
725
|
-
* Search result with metadata
|
|
726
|
-
*/
|
|
727
|
-
interface SearchResult {
|
|
728
|
-
log: LogEntry;
|
|
729
|
-
score: number;
|
|
730
|
-
highlights?: SearchHighlight[];
|
|
731
|
-
matches?: SearchMatch[];
|
|
732
|
-
context?: LogEntry[];
|
|
733
|
-
relatedLogs?: RelatedLog[];
|
|
734
|
-
}
|
|
735
|
-
/**
|
|
736
|
-
* Search highlight information
|
|
737
|
-
*/
|
|
738
|
-
interface SearchHighlight {
|
|
739
|
-
field: string;
|
|
740
|
-
fragments: string[];
|
|
741
|
-
matchedTerms: string[];
|
|
742
|
-
}
|
|
743
|
-
/**
|
|
744
|
-
* Search match details
|
|
745
|
-
*/
|
|
746
|
-
interface SearchMatch {
|
|
747
|
-
field: string;
|
|
748
|
-
value: string;
|
|
749
|
-
position: number;
|
|
750
|
-
length: number;
|
|
751
|
-
}
|
|
752
|
-
/**
|
|
753
|
-
* Related log entry
|
|
754
|
-
*/
|
|
755
|
-
interface RelatedLog {
|
|
756
|
-
log: LogEntry;
|
|
757
|
-
relationship: RelationshipType;
|
|
758
|
-
score: number;
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* Type of relationship between logs
|
|
762
|
-
*/
|
|
763
|
-
type RelationshipType = 'same_trace' | 'same_user' | 'same_session' | 'temporal_proximity' | 'error_cascade' | 'similar_pattern';
|
|
764
|
-
/**
|
|
765
|
-
* Correlated logs grouped by trace ID or other criteria
|
|
766
|
-
*/
|
|
767
|
-
interface CorrelatedLogs {
|
|
768
|
-
traceId?: string;
|
|
769
|
-
correlationKey: string;
|
|
770
|
-
logs: LogEntry[];
|
|
771
|
-
timeline: TimelineEvent[];
|
|
772
|
-
summary?: LogCorrelationSummary;
|
|
773
|
-
}
|
|
774
|
-
/**
|
|
775
|
-
* Timeline event for correlated logs
|
|
776
|
-
*/
|
|
777
|
-
interface TimelineEvent {
|
|
778
|
-
timestamp: Date;
|
|
779
|
-
log: LogEntry;
|
|
780
|
-
eventType: 'start' | 'end' | 'error' | 'milestone' | 'info';
|
|
781
|
-
duration?: number;
|
|
782
|
-
}
|
|
783
|
-
/**
|
|
784
|
-
* Summary of correlated logs
|
|
785
|
-
*/
|
|
786
|
-
interface LogCorrelationSummary {
|
|
787
|
-
totalLogs: number;
|
|
788
|
-
errorCount: number;
|
|
789
|
-
warningCount: number;
|
|
790
|
-
duration?: number;
|
|
791
|
-
services: string[];
|
|
792
|
-
criticalPath?: LogEntry[];
|
|
793
|
-
}
|
|
794
|
-
/**
|
|
795
|
-
* Similar log entry
|
|
796
|
-
*/
|
|
797
|
-
interface SimilarLog {
|
|
798
|
-
log: LogEntry;
|
|
799
|
-
similarity: number;
|
|
800
|
-
matchedPatterns: string[];
|
|
801
|
-
reason: string;
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* Search query with metadata
|
|
805
|
-
*/
|
|
806
|
-
interface SearchQuery {
|
|
807
|
-
query: string;
|
|
808
|
-
filters?: SearchFilters;
|
|
809
|
-
options?: SearchOptions;
|
|
810
|
-
timestamp: Date;
|
|
811
|
-
userId?: string;
|
|
812
|
-
}
|
|
813
|
-
/**
|
|
814
|
-
* Search options
|
|
815
|
-
*/
|
|
816
|
-
interface SearchOptions {
|
|
817
|
-
limit?: number;
|
|
818
|
-
offset?: number;
|
|
819
|
-
sortBy?: SortField;
|
|
820
|
-
sortOrder?: 'asc' | 'desc';
|
|
821
|
-
includeContext?: boolean;
|
|
822
|
-
contextSize?: number;
|
|
823
|
-
highlightMatches?: boolean;
|
|
824
|
-
findSimilar?: boolean;
|
|
825
|
-
correlate?: boolean;
|
|
826
|
-
semanticSearch?: boolean;
|
|
827
|
-
}
|
|
828
|
-
/**
|
|
829
|
-
* Sort field options
|
|
830
|
-
*/
|
|
831
|
-
type SortField = 'timestamp' | 'level' | 'score' | 'relevance';
|
|
832
|
-
/**
|
|
833
|
-
* Search suggestion
|
|
834
|
-
*/
|
|
835
|
-
interface SearchSuggestion {
|
|
836
|
-
text: string;
|
|
837
|
-
type: SuggestionType;
|
|
838
|
-
category?: string;
|
|
839
|
-
frequency?: number;
|
|
840
|
-
lastUsed?: Date;
|
|
841
|
-
}
|
|
842
|
-
/**
|
|
843
|
-
* Suggestion type
|
|
844
|
-
*/
|
|
845
|
-
type SuggestionType = 'field' | 'value' | 'operator' | 'query_history' | 'pattern' | 'filter';
|
|
846
|
-
/**
|
|
847
|
-
* Search statistics
|
|
848
|
-
*/
|
|
849
|
-
interface SearchStats {
|
|
850
|
-
totalResults: number;
|
|
851
|
-
executionTime: number;
|
|
852
|
-
indexSize: number;
|
|
853
|
-
cacheHitRate?: number;
|
|
854
|
-
topTerms?: string[];
|
|
855
|
-
}
|
|
856
|
-
/**
|
|
857
|
-
* Semantic index for intelligent search
|
|
858
|
-
*/
|
|
859
|
-
interface SemanticIndex {
|
|
860
|
-
version: string;
|
|
861
|
-
indexedCount: number;
|
|
862
|
-
lastUpdated: Date;
|
|
863
|
-
embeddings?: Map<string, number[]>;
|
|
864
|
-
clusters?: LogCluster[];
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Log cluster for grouping similar logs
|
|
868
|
-
*/
|
|
869
|
-
interface LogCluster {
|
|
870
|
-
id: string;
|
|
871
|
-
centroid: number[];
|
|
872
|
-
logs: LogEntry[];
|
|
873
|
-
pattern: string;
|
|
874
|
-
frequency: number;
|
|
875
|
-
labels?: string[];
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Log pattern for pattern recognition
|
|
879
|
-
*/
|
|
880
|
-
interface LogPattern {
|
|
881
|
-
id: string;
|
|
882
|
-
pattern: string;
|
|
883
|
-
regex?: RegExp;
|
|
884
|
-
examples: LogEntry[];
|
|
885
|
-
frequency: number;
|
|
886
|
-
lastSeen: Date;
|
|
887
|
-
category?: string;
|
|
888
|
-
severity?: string;
|
|
889
|
-
}
|
|
890
|
-
/**
|
|
891
|
-
* Anomaly detection result
|
|
892
|
-
*/
|
|
893
|
-
interface AnomalyDetection {
|
|
894
|
-
log: LogEntry;
|
|
895
|
-
anomalyScore: number;
|
|
896
|
-
reason: string;
|
|
897
|
-
expectedPattern?: string;
|
|
898
|
-
deviations: string[];
|
|
899
|
-
}
|
|
900
|
-
/**
|
|
901
|
-
* Natural language query parsed result
|
|
902
|
-
*/
|
|
903
|
-
interface ParsedNLQuery {
|
|
904
|
-
originalQuery: string;
|
|
905
|
-
intent: QueryIntent;
|
|
906
|
-
entities: QueryEntity[];
|
|
907
|
-
filters: SearchFilters;
|
|
908
|
-
timeRange?: TimeRange;
|
|
909
|
-
confidence: number;
|
|
910
|
-
}
|
|
911
|
-
/**
|
|
912
|
-
* Query intent
|
|
913
|
-
*/
|
|
914
|
-
type QueryIntent = 'find_errors' | 'trace_request' | 'find_user_activity' | 'performance_analysis' | 'find_similar' | 'time_range_query' | 'correlation' | 'general_search';
|
|
915
|
-
/**
|
|
916
|
-
* Query entity extracted from natural language
|
|
917
|
-
*/
|
|
918
|
-
interface QueryEntity {
|
|
919
|
-
type: EntityType;
|
|
920
|
-
value: string;
|
|
921
|
-
field?: string;
|
|
922
|
-
confidence: number;
|
|
923
|
-
}
|
|
924
|
-
/**
|
|
925
|
-
* Entity type
|
|
926
|
-
*/
|
|
927
|
-
type EntityType = 'level' | 'service' | 'user_id' | 'trace_id' | 'time' | 'error_type' | 'field_value';
|
|
928
|
-
/**
|
|
929
|
-
* Search preset for saving common searches
|
|
930
|
-
*/
|
|
931
|
-
interface SearchPreset {
|
|
932
|
-
id: string;
|
|
933
|
-
name: string;
|
|
934
|
-
description?: string;
|
|
935
|
-
query: string;
|
|
936
|
-
filters: SearchFilters;
|
|
937
|
-
options: SearchOptions;
|
|
938
|
-
createdAt: Date;
|
|
939
|
-
updatedAt: Date;
|
|
940
|
-
userId?: string;
|
|
941
|
-
shared?: boolean;
|
|
942
|
-
}
|
|
943
|
-
/**
|
|
944
|
-
* Export options for search results
|
|
945
|
-
*/
|
|
946
|
-
interface ExportOptions {
|
|
947
|
-
format: 'json' | 'csv' | 'text';
|
|
948
|
-
includeMetadata?: boolean;
|
|
949
|
-
filename?: string;
|
|
950
|
-
fields?: string[];
|
|
951
|
-
}
|
|
952
|
-
//#endregion
|
|
953
|
-
//#region src/search/search-manager.d.ts
|
|
954
|
-
/**
|
|
955
|
-
* Configuration for search manager
|
|
956
|
-
*/
|
|
957
|
-
interface SearchManagerConfig {
|
|
958
|
-
enableNLP?: boolean;
|
|
959
|
-
enablePatternRecognition?: boolean;
|
|
960
|
-
enableCorrelation?: boolean;
|
|
961
|
-
maxIndexSize?: number;
|
|
962
|
-
autoOptimize?: boolean;
|
|
963
|
-
}
|
|
964
|
-
/**
|
|
965
|
-
* Main search manager class
|
|
966
|
-
*/
|
|
967
|
-
declare class SearchManager {
|
|
968
|
-
private searchEngine;
|
|
969
|
-
private indexer;
|
|
970
|
-
private patternEngine?;
|
|
971
|
-
private correlationEngine?;
|
|
972
|
-
private config;
|
|
973
|
-
constructor(config?: SearchManagerConfig);
|
|
974
|
-
/**
|
|
975
|
-
* Index new logs
|
|
976
|
-
*/
|
|
977
|
-
indexLogs(logs: LogEntry[]): Promise<void>;
|
|
978
|
-
/**
|
|
979
|
-
* Add a single log to the index
|
|
980
|
-
*/
|
|
981
|
-
indexLog(log: LogEntry): Promise<void>;
|
|
982
|
-
/**
|
|
983
|
-
* Perform a search
|
|
984
|
-
*/
|
|
985
|
-
search(query: string, filters?: SearchFilters, options?: SearchOptions): Promise<SearchResult[]>;
|
|
986
|
-
/**
|
|
987
|
-
* Perform a natural language search
|
|
988
|
-
*/
|
|
989
|
-
naturalLanguageSearch(query: string): Promise<SearchResult[]>;
|
|
990
|
-
/**
|
|
991
|
-
* Find logs correlated by trace ID
|
|
992
|
-
*/
|
|
993
|
-
correlateByTraceId(traceId: string): Promise<CorrelatedLogs>;
|
|
994
|
-
/**
|
|
995
|
-
* Find similar logs
|
|
996
|
-
*/
|
|
997
|
-
findSimilarLogs(logEntry: LogEntry, limit?: number): Promise<SimilarLog[]>;
|
|
998
|
-
/**
|
|
999
|
-
* Find logs related to a given log
|
|
1000
|
-
*/
|
|
1001
|
-
findRelatedLogs(log: LogEntry, limit?: number): Promise<RelatedLog[]>;
|
|
1002
|
-
/**
|
|
1003
|
-
* Get search suggestions
|
|
1004
|
-
*/
|
|
1005
|
-
getSuggestions(partialQuery: string, limit?: number): Promise<SearchSuggestion[]>;
|
|
1006
|
-
/**
|
|
1007
|
-
* Get search statistics
|
|
1008
|
-
*/
|
|
1009
|
-
getStats(): Promise<SearchStats>;
|
|
1010
|
-
/**
|
|
1011
|
-
* Parse natural language query
|
|
1012
|
-
*/
|
|
1013
|
-
parseNaturalLanguageQuery(query: string): Promise<ParsedNLQuery>;
|
|
1014
|
-
/**
|
|
1015
|
-
* Save a search preset
|
|
1016
|
-
*/
|
|
1017
|
-
savePreset(preset: Omit<SearchPreset, 'id' | 'createdAt' | 'updatedAt'>): Promise<SearchPreset>;
|
|
1018
|
-
/**
|
|
1019
|
-
* Get saved presets
|
|
1020
|
-
*/
|
|
1021
|
-
getPresets(userId?: string): Promise<SearchPreset[]>;
|
|
1022
|
-
/**
|
|
1023
|
-
* Delete a preset
|
|
1024
|
-
*/
|
|
1025
|
-
deletePreset(presetId: string): Promise<void>;
|
|
1026
|
-
/**
|
|
1027
|
-
* Detect log patterns
|
|
1028
|
-
*/
|
|
1029
|
-
detectPatterns(): Promise<LogPattern[]>;
|
|
1030
|
-
/**
|
|
1031
|
-
* Get detected patterns
|
|
1032
|
-
*/
|
|
1033
|
-
getPatterns(): LogPattern[];
|
|
1034
|
-
/**
|
|
1035
|
-
* Detect anomalies in logs
|
|
1036
|
-
*/
|
|
1037
|
-
detectAnomalies(): Promise<AnomalyDetection[]>;
|
|
1038
|
-
/**
|
|
1039
|
-
* Correlate logs by multiple criteria
|
|
1040
|
-
*/
|
|
1041
|
-
correlateByMultipleCriteria(criteria: {
|
|
1042
|
-
traceId?: boolean;
|
|
1043
|
-
userId?: boolean;
|
|
1044
|
-
sessionId?: boolean;
|
|
1045
|
-
temporal?: boolean;
|
|
1046
|
-
errorCascade?: boolean;
|
|
1047
|
-
}): Promise<Map<string, CorrelatedLogs>>;
|
|
1048
|
-
/**
|
|
1049
|
-
* Analyze error cascades
|
|
1050
|
-
*/
|
|
1051
|
-
analyzeErrorCascade(traceId: string): Promise<{
|
|
1052
|
-
rootCause?: LogEntry;
|
|
1053
|
-
cascade: LogEntry[];
|
|
1054
|
-
impactedServices: string[];
|
|
1055
|
-
}>;
|
|
1056
|
-
/**
|
|
1057
|
-
* Export search results
|
|
1058
|
-
*/
|
|
1059
|
-
exportResults(results: SearchResult[], options: ExportOptions): Promise<string>;
|
|
1060
|
-
/**
|
|
1061
|
-
* Clear all indexed data
|
|
1062
|
-
*/
|
|
1063
|
-
clearIndex(): Promise<void>;
|
|
1064
|
-
/**
|
|
1065
|
-
* Optimize the index
|
|
1066
|
-
*/
|
|
1067
|
-
optimizeIndex(): Promise<void>;
|
|
1068
|
-
/**
|
|
1069
|
-
* Get index statistics
|
|
1070
|
-
*/
|
|
1071
|
-
getIndexStats(): Promise<{
|
|
1072
|
-
totalDocuments: number;
|
|
1073
|
-
indexSize: number;
|
|
1074
|
-
lastOptimized?: Date;
|
|
1075
|
-
}>;
|
|
1076
|
-
/**
|
|
1077
|
-
* Remove old logs
|
|
1078
|
-
*/
|
|
1079
|
-
removeOldLogs(olderThan: Date): Promise<number>;
|
|
1080
|
-
private exportAsJSON;
|
|
1081
|
-
private exportAsCSV;
|
|
1082
|
-
private exportAsText;
|
|
1083
|
-
private filterFields;
|
|
1084
|
-
private getNestedValue;
|
|
1085
|
-
private escapeCSVValue;
|
|
1086
|
-
}
|
|
1087
|
-
//#endregion
|
|
1088
|
-
//#region src/search/core/log-indexer.interface.d.ts
|
|
1089
|
-
/**
|
|
1090
|
-
* Log indexer interface
|
|
1091
|
-
*/
|
|
1092
|
-
interface ILogIndexer {
|
|
1093
|
-
/**
|
|
1094
|
-
* Index a single log entry
|
|
1095
|
-
* @param log - Log entry to index
|
|
1096
|
-
*/
|
|
1097
|
-
indexLog(log: LogEntry): Promise<void>;
|
|
1098
|
-
/**
|
|
1099
|
-
* Index multiple log entries in batch
|
|
1100
|
-
* @param logs - Array of log entries to index
|
|
1101
|
-
*/
|
|
1102
|
-
indexBatch(logs: LogEntry[]): Promise<void>;
|
|
1103
|
-
/**
|
|
1104
|
-
* Build semantic index for intelligent search
|
|
1105
|
-
* @param logs - Array of log entries to build index from
|
|
1106
|
-
* @returns Semantic index
|
|
1107
|
-
*/
|
|
1108
|
-
buildSemanticIndex(logs: LogEntry[]): Promise<SemanticIndex>;
|
|
1109
|
-
/**
|
|
1110
|
-
* Update search suggestions based on search history
|
|
1111
|
-
* @param searchHistory - Array of past search queries
|
|
1112
|
-
*/
|
|
1113
|
-
updateSearchSuggestions(searchHistory: SearchQuery[]): Promise<void>;
|
|
1114
|
-
/**
|
|
1115
|
-
* Optimize the index for better performance
|
|
1116
|
-
*/
|
|
1117
|
-
optimizeIndex(): Promise<void>;
|
|
1118
|
-
/**
|
|
1119
|
-
* Clear the index
|
|
1120
|
-
*/
|
|
1121
|
-
clearIndex(): Promise<void>;
|
|
1122
|
-
/**
|
|
1123
|
-
* Get index statistics
|
|
1124
|
-
* @returns Index statistics
|
|
1125
|
-
*/
|
|
1126
|
-
getIndexStats(): Promise<{
|
|
1127
|
-
totalDocuments: number;
|
|
1128
|
-
indexSize: number;
|
|
1129
|
-
lastOptimized?: Date;
|
|
1130
|
-
}>;
|
|
1131
|
-
/**
|
|
1132
|
-
* Remove logs older than specified time
|
|
1133
|
-
* @param olderThan - Remove logs older than this date
|
|
1134
|
-
* @returns Number of logs removed
|
|
1135
|
-
*/
|
|
1136
|
-
removeOldLogs(olderThan: Date): Promise<number>;
|
|
1137
|
-
}
|
|
1138
|
-
//#endregion
|
|
1139
|
-
//#region src/search/core/basic-log-indexer.d.ts
|
|
1140
|
-
/**
|
|
1141
|
-
* Basic log indexer implementation
|
|
1142
|
-
*/
|
|
1143
|
-
declare class BasicLogIndexer implements ILogIndexer {
|
|
1144
|
-
private options?;
|
|
1145
|
-
private index;
|
|
1146
|
-
private fieldIndices;
|
|
1147
|
-
private semanticIndex;
|
|
1148
|
-
private lastOptimized?;
|
|
1149
|
-
constructor(options?: {
|
|
1150
|
-
maxIndexSize?: number;
|
|
1151
|
-
autoOptimize?: boolean;
|
|
1152
|
-
optimizeThreshold?: number;
|
|
1153
|
-
} | undefined);
|
|
1154
|
-
/**
|
|
1155
|
-
* Index a single log entry
|
|
1156
|
-
*/
|
|
1157
|
-
indexLog(log: LogEntry): Promise<void>;
|
|
1158
|
-
/**
|
|
1159
|
-
* Index multiple log entries in batch
|
|
1160
|
-
*/
|
|
1161
|
-
indexBatch(logs: LogEntry[]): Promise<void>;
|
|
1162
|
-
/**
|
|
1163
|
-
* Build semantic index for intelligent search
|
|
1164
|
-
*/
|
|
1165
|
-
buildSemanticIndex(logs: LogEntry[]): Promise<SemanticIndex>;
|
|
1166
|
-
/**
|
|
1167
|
-
* Update search suggestions based on search history
|
|
1168
|
-
*/
|
|
1169
|
-
updateSearchSuggestions(searchHistory: SearchQuery[]): Promise<void>;
|
|
1170
|
-
/**
|
|
1171
|
-
* Optimize the index for better performance
|
|
1172
|
-
*/
|
|
1173
|
-
optimizeIndex(): Promise<void>;
|
|
1174
|
-
/**
|
|
1175
|
-
* Clear the index
|
|
1176
|
-
*/
|
|
1177
|
-
clearIndex(): Promise<void>;
|
|
1178
|
-
/**
|
|
1179
|
-
* Get index statistics
|
|
1180
|
-
*/
|
|
1181
|
-
getIndexStats(): Promise<{
|
|
1182
|
-
totalDocuments: number;
|
|
1183
|
-
indexSize: number;
|
|
1184
|
-
lastOptimized?: Date;
|
|
1185
|
-
}>;
|
|
1186
|
-
/**
|
|
1187
|
-
* Remove logs older than specified time
|
|
1188
|
-
*/
|
|
1189
|
-
removeOldLogs(olderThan: Date): Promise<number>;
|
|
1190
|
-
/**
|
|
1191
|
-
* Search logs by field
|
|
1192
|
-
*/
|
|
1193
|
-
searchByField(field: string, value: string): LogEntry[];
|
|
1194
|
-
/**
|
|
1195
|
-
* Get all indexed logs
|
|
1196
|
-
*/
|
|
1197
|
-
getAllLogs(): LogEntry[];
|
|
1198
|
-
private initializeFieldIndices;
|
|
1199
|
-
private updateFieldIndices;
|
|
1200
|
-
private addToFieldIndex;
|
|
1201
|
-
private removeFromFieldIndices;
|
|
1202
|
-
private generateLogId;
|
|
1203
|
-
private calculateIndexSize;
|
|
1204
|
-
private removeOldestLogs;
|
|
1205
|
-
private clusterLogs;
|
|
1206
|
-
}
|
|
1207
|
-
//#endregion
|
|
1208
|
-
//#region src/search/core/search-engine.interface.d.ts
|
|
1209
|
-
/**
|
|
1210
|
-
* Main search engine interface
|
|
1211
|
-
*/
|
|
1212
|
-
interface ILogSearchEngine {
|
|
1213
|
-
/**
|
|
1214
|
-
* Perform a full-text search across logs
|
|
1215
|
-
* @param query - Search query string
|
|
1216
|
-
* @param filters - Optional filters to narrow down results
|
|
1217
|
-
* @param options - Search options
|
|
1218
|
-
* @returns Array of search results
|
|
1219
|
-
*/
|
|
1220
|
-
search(query: string, filters?: SearchFilters, options?: SearchOptions): Promise<SearchResult[]>;
|
|
1221
|
-
/**
|
|
1222
|
-
* Perform a natural language search
|
|
1223
|
-
* @param query - Natural language query
|
|
1224
|
-
* @returns Array of search results
|
|
1225
|
-
*/
|
|
1226
|
-
naturalLanguageSearch(query: string): Promise<SearchResult[]>;
|
|
1227
|
-
/**
|
|
1228
|
-
* Find logs correlated by trace ID
|
|
1229
|
-
* @param traceId - Trace ID to correlate logs
|
|
1230
|
-
* @returns Correlated logs
|
|
1231
|
-
*/
|
|
1232
|
-
correlateByTraceId(traceId: string): Promise<CorrelatedLogs>;
|
|
1233
|
-
/**
|
|
1234
|
-
* Find logs similar to a given log entry
|
|
1235
|
-
* @param logEntry - Log entry to find similar logs for
|
|
1236
|
-
* @param limit - Maximum number of similar logs to return
|
|
1237
|
-
* @returns Array of similar logs
|
|
1238
|
-
*/
|
|
1239
|
-
findSimilarLogs(logEntry: LogEntry, limit?: number): Promise<SimilarLog[]>;
|
|
1240
|
-
/**
|
|
1241
|
-
* Get search suggestions based on partial query
|
|
1242
|
-
* @param partialQuery - Partial query string
|
|
1243
|
-
* @param limit - Maximum number of suggestions
|
|
1244
|
-
* @returns Array of suggestions
|
|
1245
|
-
*/
|
|
1246
|
-
getSuggestions(partialQuery: string, limit?: number): Promise<SearchSuggestion[]>;
|
|
1247
|
-
/**
|
|
1248
|
-
* Get search statistics
|
|
1249
|
-
* @returns Search statistics
|
|
1250
|
-
*/
|
|
1251
|
-
getStats(): Promise<SearchStats>;
|
|
1252
|
-
/**
|
|
1253
|
-
* Parse natural language query
|
|
1254
|
-
* @param query - Natural language query
|
|
1255
|
-
* @returns Parsed query with intent and entities
|
|
1256
|
-
*/
|
|
1257
|
-
parseNaturalLanguageQuery(query: string): Promise<ParsedNLQuery>;
|
|
1258
|
-
/**
|
|
1259
|
-
* Save a search preset
|
|
1260
|
-
* @param preset - Search preset to save
|
|
1261
|
-
* @returns Saved preset with ID
|
|
1262
|
-
*/
|
|
1263
|
-
savePreset(preset: Omit<SearchPreset, 'id' | 'createdAt' | 'updatedAt'>): Promise<SearchPreset>;
|
|
1264
|
-
/**
|
|
1265
|
-
* Get saved presets
|
|
1266
|
-
* @param userId - Optional user ID to filter presets
|
|
1267
|
-
* @returns Array of presets
|
|
1268
|
-
*/
|
|
1269
|
-
getPresets(userId?: string): Promise<SearchPreset[]>;
|
|
1270
|
-
/**
|
|
1271
|
-
* Delete a preset
|
|
1272
|
-
* @param presetId - ID of preset to delete
|
|
1273
|
-
*/
|
|
1274
|
-
deletePreset(presetId: string): Promise<void>;
|
|
1275
|
-
}
|
|
1276
|
-
//#endregion
|
|
1277
|
-
//#region src/search/core/basic-search-engine.d.ts
|
|
1278
|
-
/**
|
|
1279
|
-
* Basic search engine implementation
|
|
1280
|
-
*/
|
|
1281
|
-
declare class BasicSearchEngine implements ILogSearchEngine {
|
|
1282
|
-
private options?;
|
|
1283
|
-
private logs;
|
|
1284
|
-
private presets;
|
|
1285
|
-
private searchHistory;
|
|
1286
|
-
private suggestionCache;
|
|
1287
|
-
constructor(options?: {
|
|
1288
|
-
maxHistorySize?: number;
|
|
1289
|
-
cacheSize?: number;
|
|
1290
|
-
} | undefined);
|
|
1291
|
-
/**
|
|
1292
|
-
* Add logs to the search index
|
|
1293
|
-
*/
|
|
1294
|
-
addLogs(logs: LogEntry[]): void;
|
|
1295
|
-
/**
|
|
1296
|
-
* Clear all logs from the index
|
|
1297
|
-
*/
|
|
1298
|
-
clearLogs(): void;
|
|
1299
|
-
/**
|
|
1300
|
-
* Get all indexed logs
|
|
1301
|
-
*/
|
|
1302
|
-
getLogs(): LogEntry[];
|
|
1303
|
-
/**
|
|
1304
|
-
* Perform a full-text search across logs
|
|
1305
|
-
*/
|
|
1306
|
-
search(query: string, filters?: SearchFilters, options?: SearchOptions): Promise<SearchResult[]>;
|
|
1307
|
-
/**
|
|
1308
|
-
* Natural language search (basic implementation)
|
|
1309
|
-
*/
|
|
1310
|
-
naturalLanguageSearch(query: string): Promise<SearchResult[]>;
|
|
1311
|
-
/**
|
|
1312
|
-
* Find logs correlated by trace ID
|
|
1313
|
-
*/
|
|
1314
|
-
correlateByTraceId(traceId: string): Promise<CorrelatedLogs>;
|
|
1315
|
-
/**
|
|
1316
|
-
* Find similar logs based on content similarity
|
|
1317
|
-
*/
|
|
1318
|
-
findSimilarLogs(logEntry: LogEntry, limit?: number): Promise<SimilarLog[]>;
|
|
1319
|
-
/**
|
|
1320
|
-
* Get search suggestions
|
|
1321
|
-
*/
|
|
1322
|
-
getSuggestions(partialQuery: string, limit?: number): Promise<SearchSuggestion[]>;
|
|
1323
|
-
/**
|
|
1324
|
-
* Get search statistics
|
|
1325
|
-
*/
|
|
1326
|
-
getStats(): Promise<SearchStats>;
|
|
1327
|
-
/**
|
|
1328
|
-
* Parse natural language query
|
|
1329
|
-
*/
|
|
1330
|
-
parseNaturalLanguageQuery(query: string): Promise<ParsedNLQuery>;
|
|
1331
|
-
/**
|
|
1332
|
-
* Save a search preset
|
|
1333
|
-
*/
|
|
1334
|
-
savePreset(preset: Omit<SearchPreset, 'id' | 'createdAt' | 'updatedAt'>): Promise<SearchPreset>;
|
|
1335
|
-
/**
|
|
1336
|
-
* Get saved presets
|
|
1337
|
-
*/
|
|
1338
|
-
getPresets(userId?: string): Promise<SearchPreset[]>;
|
|
1339
|
-
/**
|
|
1340
|
-
* Delete a preset
|
|
1341
|
-
*/
|
|
1342
|
-
deletePreset(presetId: string): Promise<void>;
|
|
1343
|
-
private applyFilters;
|
|
1344
|
-
private performTextSearch;
|
|
1345
|
-
private getSearchableText;
|
|
1346
|
-
private getHighlightFragments;
|
|
1347
|
-
private applySorting;
|
|
1348
|
-
private applyPagination;
|
|
1349
|
-
private enrichWithContext;
|
|
1350
|
-
private calculateSimilarity;
|
|
1351
|
-
private calculateTextSimilarity;
|
|
1352
|
-
private findMatchedPatterns;
|
|
1353
|
-
private generateSimilarityReason;
|
|
1354
|
-
private extractTimeRange;
|
|
1355
|
-
private addToSearchHistory;
|
|
1356
|
-
private getTopTerms;
|
|
1357
|
-
private generateId;
|
|
1358
|
-
}
|
|
1359
|
-
//#endregion
|
|
1360
|
-
//#region src/search/engines/correlation-engine.d.ts
|
|
1361
|
-
/**
|
|
1362
|
-
* Correlation engine for log analysis
|
|
1363
|
-
*/
|
|
1364
|
-
declare class CorrelationEngine {
|
|
1365
|
-
private options?;
|
|
1366
|
-
constructor(options?: {
|
|
1367
|
-
maxCorrelationDistance?: number;
|
|
1368
|
-
temporalWindowMs?: number;
|
|
1369
|
-
minSimilarityScore?: number;
|
|
1370
|
-
} | undefined);
|
|
1371
|
-
/**
|
|
1372
|
-
* Find logs related to a given log entry
|
|
1373
|
-
*/
|
|
1374
|
-
findRelatedLogs(log: LogEntry, allLogs: LogEntry[], limit?: number): Promise<RelatedLog[]>;
|
|
1375
|
-
/**
|
|
1376
|
-
* Correlate logs by multiple criteria
|
|
1377
|
-
*/
|
|
1378
|
-
correlateByMultipleCriteria(logs: LogEntry[], criteria: {
|
|
1379
|
-
traceId?: boolean;
|
|
1380
|
-
userId?: boolean;
|
|
1381
|
-
sessionId?: boolean;
|
|
1382
|
-
temporal?: boolean;
|
|
1383
|
-
errorCascade?: boolean;
|
|
1384
|
-
}): Promise<Map<string, CorrelatedLogs>>;
|
|
1385
|
-
/**
|
|
1386
|
-
* Build a timeline from correlated logs
|
|
1387
|
-
*/
|
|
1388
|
-
buildTimeline(logs: LogEntry[]): TimelineEvent[];
|
|
1389
|
-
/**
|
|
1390
|
-
* Analyze error cascades
|
|
1391
|
-
*/
|
|
1392
|
-
analyzeErrorCascade(logs: LogEntry[]): Promise<{
|
|
1393
|
-
rootCause?: LogEntry;
|
|
1394
|
-
cascade: LogEntry[];
|
|
1395
|
-
impactedServices: string[];
|
|
1396
|
-
}>;
|
|
1397
|
-
private correlateByTraceId;
|
|
1398
|
-
private correlateByUserId;
|
|
1399
|
-
private correlateBySessionId;
|
|
1400
|
-
private correlateByTemporalProximity;
|
|
1401
|
-
private correlateErrorCascades;
|
|
1402
|
-
private buildErrorCascade;
|
|
1403
|
-
private findRelationships;
|
|
1404
|
-
private calculateRelationshipScore;
|
|
1405
|
-
private haveSimilarPattern;
|
|
1406
|
-
private normalizeMessage;
|
|
1407
|
-
private determineEventType;
|
|
1408
|
-
private deduplicateRelatedLogs;
|
|
1409
|
-
private convertToCorrelatedLogs;
|
|
1410
|
-
private generateSummary;
|
|
1411
|
-
}
|
|
1412
|
-
//#endregion
|
|
1413
|
-
//#region src/search/engines/nlp-search-engine.d.ts
|
|
1414
|
-
/**
|
|
1415
|
-
* NLP-enhanced search engine
|
|
1416
|
-
*/
|
|
1417
|
-
declare class NLPSearchEngine extends BasicSearchEngine {
|
|
1418
|
-
private intentPatterns;
|
|
1419
|
-
private entityPatterns;
|
|
1420
|
-
constructor(options?: Record<string, unknown>);
|
|
1421
|
-
/**
|
|
1422
|
-
* Enhanced natural language query parsing
|
|
1423
|
-
*/
|
|
1424
|
-
parseNaturalLanguageQuery(query: string): Promise<ParsedNLQuery>;
|
|
1425
|
-
/**
|
|
1426
|
-
* Enhanced natural language search
|
|
1427
|
-
*/
|
|
1428
|
-
naturalLanguageSearch(query: string): Promise<SearchResult[]>;
|
|
1429
|
-
private initializePatterns;
|
|
1430
|
-
private detectIntent;
|
|
1431
|
-
private extractEntities;
|
|
1432
|
-
private applyEntityToFilter;
|
|
1433
|
-
private extractAdvancedTimeRange;
|
|
1434
|
-
private calculateConfidence;
|
|
1435
|
-
private getOptionsForIntent;
|
|
1436
|
-
private extractCleanQuery;
|
|
1437
|
-
}
|
|
1438
|
-
//#endregion
|
|
1439
|
-
//#region src/search/engines/pattern-recognition-engine.d.ts
|
|
1440
|
-
/**
|
|
1441
|
-
* Pattern recognition engine for log analysis
|
|
1442
|
-
*/
|
|
1443
|
-
declare class PatternRecognitionEngine {
|
|
1444
|
-
private options?;
|
|
1445
|
-
private patterns;
|
|
1446
|
-
private patternFrequencies;
|
|
1447
|
-
constructor(options?: {
|
|
1448
|
-
minFrequency?: number;
|
|
1449
|
-
maxPatterns?: number;
|
|
1450
|
-
anomalyThreshold?: number;
|
|
1451
|
-
} | undefined);
|
|
1452
|
-
/**
|
|
1453
|
-
* Analyze logs and detect patterns
|
|
1454
|
-
*/
|
|
1455
|
-
analyzePatterns(logs: LogEntry[]): Promise<LogPattern[]>;
|
|
1456
|
-
/**
|
|
1457
|
-
* Detect anomalies in logs
|
|
1458
|
-
*/
|
|
1459
|
-
detectAnomalies(logs: LogEntry[]): Promise<AnomalyDetection[]>;
|
|
1460
|
-
/**
|
|
1461
|
-
* Find patterns matching a log entry
|
|
1462
|
-
*/
|
|
1463
|
-
findMatchingPatterns(log: LogEntry): LogPattern[];
|
|
1464
|
-
/**
|
|
1465
|
-
* Get all detected patterns
|
|
1466
|
-
*/
|
|
1467
|
-
getPatterns(): LogPattern[];
|
|
1468
|
-
/**
|
|
1469
|
-
* Get pattern by ID
|
|
1470
|
-
*/
|
|
1471
|
-
getPattern(patternId: string): LogPattern | undefined;
|
|
1472
|
-
private extractMessagePatterns;
|
|
1473
|
-
private extractErrorPatterns;
|
|
1474
|
-
private extractTimingPatterns;
|
|
1475
|
-
private normalizeMessage;
|
|
1476
|
-
private extractErrorPattern;
|
|
1477
|
-
private calculateAnomalyScore;
|
|
1478
|
-
private generateAnomalyReason;
|
|
1479
|
-
private findDeviations;
|
|
1480
|
-
private doesLogMatchPattern;
|
|
1481
|
-
}
|
|
1482
|
-
//#endregion
|
|
1483
176
|
//#region src/index.d.ts
|
|
1484
177
|
/**
|
|
1485
178
|
* Default configuration for Logixia logger
|
|
@@ -1566,5 +259,5 @@ declare const logger: LogixiaLogger<{
|
|
|
1566
259
|
outputs: string[];
|
|
1567
260
|
}>;
|
|
1568
261
|
//#endregion
|
|
1569
|
-
export {
|
|
262
|
+
export { ContextData, CustomLevelMethods, DEFAULT_CONFIG, DEFAULT_LOG_COLORS, DEFAULT_LOG_LEVELS, DEFAULT_TRACE_HEADERS, Environment, ErrorSerializationOptions, ExtractLevels, FlushOnExitOptions, GracefulShutdownConfig, HttpError, HttpRequest, HttpResponse, IBaseLogger, ILogFormatter, ILogger, ILoggerDefault, JsonFormatter, KafkaTraceInterceptor, LOGIXIA_LOGGER_CONFIG, LOGIXIA_LOGGER_PREFIX, LogColor, LogEntry, LogFieldKey, LogLevel, LogLevelString, LoggerConfig, LoggerConfig as LoggerConfigInterface, LoggerWithLevels, LogixiaAsyncOptions, LogixiaLogger, LogixiaLoggerModule, LogixiaLoggerService, LogixiaOptionsFactory, NamespaceLevels, type RedactConfig, RequestContext, RequestMetrics, RequestTiming, TextFormatter, TimingEntry, TraceIdConfig, TraceIdExtractorConfig, WebSocketTraceInterceptor, applyRedaction, createLogger, createLoggerService, createTraceMiddleware, deregisterFromShutdown, extractTraceId, flushOnExit, generateTraceId, getCurrentTraceId, isError, logger, normalizeError, redactObject, registerForShutdown, resetShutdownHandlers, runWithTraceId, serializeError, setTraceId, traceStorage };
|
|
1570
263
|
//# sourceMappingURL=index.d.mts.map
|