import { Log, PerfSink, IPerfMetric, IPerfRollup } from "@spinajs/log-common"; /** * Default {@link PerfSink}: renders perf measurements as structured log entries * through the normal targets/filters/rules pipeline, on a dedicated `perf` * logger. Spans over their per-name threshold log at `warn`; under-threshold * spans log at `trace` ( kept for on-demand visibility, cheaply gated out when * trace routing is off ). Rollups log one `info` line. */ export declare class LogMetricSink extends PerfSink { protected Log: Log; protected Enabled: boolean; protected Thresholds: Record; protected OverLevel: "warn" | "error" | "info" | "debug" | "trace"; protected UnderLevel: "warn" | "error" | "info" | "debug" | "trace"; protected LogCounters: boolean; protected SqlMaxLength: number; /** * Emit a log entry for spans that came in UNDER their threshold. * * - `false` ( default ) never; a bare `orm.query: 15.2ms` says nothing actionable * and a single request produces hundreds of them, * - `true` for every metric, * - a list of metric names to trace just those, eg. `['orm.query']` for a full db * query trace without dragging in `email.send` and `template.*`, which share * this same logger. * * Over-threshold and failed spans are always logged regardless of this setting, * and the measurements themselves are never affected - they still reach every * other sink and the per-request rollup. This only controls per-span log lines. */ protected LogUnderThreshold: boolean | string[]; private logsUnderThreshold; private thresholdFor; /** * Renders the statement into the message. The `sql` field is already attached to * the entry, but most console layouts print only `${message}`, so * "Slow orm.query: 251.1ms" on its own gives no way to tell WHICH query it was. * * Bindings are deliberately left out of the message - they routinely hold * passwords, tokens and personal data. They stay in the structured fields, where a * target can opt into them. */ private sqlSuffix; collect(metric: IPerfMetric): void; onScopeEnd(rollup: IPerfRollup): void; /** * Emit through the log's MERGING-OBJECT form ( fields object FIRST, then the * message string ) so the structured variables ( durationMs, labels, sql, * error ) are attached to the entry. The `@spinajs/log` API treats a trailing * object as a printf argument, so passing fields last would silently drop * them. See the `warn(fields, message?)` overload on the `Log` base class. */ private emitAt; } //# sourceMappingURL=LogMetricSink.d.ts.map