# @mwillbanks/tuil-logging

Source: /tuil/docs/reference/packages/logging
Locale: en

OpenTelemetry-compatible log normalization parsers redaction indexing and query pipelines for tuil.



## Overview [#overview]

OpenTelemetry-compatible log normalization parsers redaction indexing and query pipelines for tuil.

`@mwillbanks/tuil-logging` is independently installable and also participates in the
umbrella `@mwillbanks/tuil` runtime where applicable.

## Installation [#installation]

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npm install @mwillbanks/tuil-logging
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm add @mwillbanks/tuil-logging
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn add @mwillbanks/tuil-logging
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun add @mwillbanks/tuil-logging
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## How it operates [#how-it-operates]

Logging adapters normalize OpenTelemetry, JSON, syslog, journald, container, and text records, redact before retention, enrich, query, and export bounded data.

<Mermaid
  chart="flowchart LR
  S0[&#x22;detect/parse&#x22;]
  S1[&#x22;normalize&#x22;]
  S2[&#x22;redact&#x22;]
  S3[&#x22;enrich&#x22;]
  S4[&#x22;retain/query&#x22;]
  S5[&#x22;export&#x22;]
  S0 --> S1
  S1 --> S2
  S2 --> S3
  S3 --> S4
  S4 --> S5"
/>

## API [#api]

| API                                                                                        | Signature                         | Description                             |
| ------------------------------------------------------------------------------------------ | --------------------------------- | --------------------------------------- |
| [`builtInLogParsers`](/tuil/docs/reference/packages/logging/api/built-in-log-parsers)           | `constant builtInLogParsers`      | Public constant builtInLogParsers.      |
| [`commonLogParser`](/tuil/docs/reference/packages/logging/api/common-log-parser)                | `constant commonLogParser`        | Public constant commonLogParser.        |
| [`compileLogQuery`](/tuil/docs/reference/packages/logging/api/compile-log-query)                | `function compileLogQuery`        | Public function compileLogQuery.        |
| [`containerLogParser`](/tuil/docs/reference/packages/logging/api/container-log-parser)          | `constant containerLogParser`     | Public constant containerLogParser.     |
| [`journaldParser`](/tuil/docs/reference/packages/logging/api/journald-parser)                   | `constant journaldParser`         | Public constant journaldParser.         |
| [`jsonLogParser`](/tuil/docs/reference/packages/logging/api/json-log-parser)                    | `constant jsonLogParser`          | Public constant jsonLogParser.          |
| [`LogBufferStatistics`](/tuil/docs/reference/packages/logging/api/log-buffer-statistics)        | `interface LogBufferStatistics`   | Public interface LogBufferStatistics.   |
| [`LogDiagnostic`](/tuil/docs/reference/packages/logging/api/log-diagnostic)                     | `interface LogDiagnostic`         | Public interface LogDiagnostic.         |
| [`LogEnricher`](/tuil/docs/reference/packages/logging/api/log-enricher)                         | `interface LogEnricher`           | Public interface LogEnricher.           |
| [`LogParser`](/tuil/docs/reference/packages/logging/api/log-parser)                             | `interface LogParser`             | Public interface LogParser.             |
| [`LogPipeline`](/tuil/docs/reference/packages/logging/api/log-pipeline)                         | `class LogPipeline`               | Public class LogPipeline.               |
| [`LogRecord`](/tuil/docs/reference/packages/logging/api/log-record)                             | `interface LogRecord`             | Public interface LogRecord.             |
| [`LogRedactor`](/tuil/docs/reference/packages/logging/api/log-redactor)                         | `interface LogRedactor`           | Public interface LogRedactor.           |
| [`LogSource`](/tuil/docs/reference/packages/logging/api/log-source)                             | `type LogSource`                  | Public type LogSource.                  |
| [`normalizeSeverity`](/tuil/docs/reference/packages/logging/api/normalize-severity)             | `function normalizeSeverity`      | Public function normalizeSeverity.      |
| [`openTelemetryLogParser`](/tuil/docs/reference/packages/logging/api/open-telemetry-log-parser) | `constant openTelemetryLogParser` | Public constant openTelemetryLogParser. |
| [`processLogParser`](/tuil/docs/reference/packages/logging/api/process-log-parser)              | `constant processLogParser`       | Public constant processLogParser.       |
| [`syslogParser`](/tuil/docs/reference/packages/logging/api/syslog-parser)                       | `constant syslogParser`           | Public constant syslogParser.           |
| [`textLogParser`](/tuil/docs/reference/packages/logging/api/text-log-parser)                    | `constant textLogParser`          | Public constant textLogParser.          |

## Events and lifecycle [#events-and-lifecycle]

Pipelines return normalized records and observable snapshots; original payloads are never exposed before redaction.

All subscriptions and registrations return a disposer or belong to an owning
runtime that disposes them in reverse order.

## Example [#example]

```tsx
import { LogPipeline } from "@mwillbanks/tuil-logging";

const pipeline = new LogPipeline({ capacity: 100_000 });
pipeline.ingest(line);
```

## Related [#related]

* [Package architecture](/tuil/docs/concepts/packages)
* [Events](/tuil/docs/concepts/events)
* [Testing](/tuil/docs/guides/testing)
