---
icon: material/set-split
---

Output integrations provide an extensible mechanisms writing TenXObject instance and template values to [event](https://doc.log10x.com/run/output/event/) and [time-series](https://doc.log10x.com/run/output/metric/) 
destinations using industry standard Java frameworks.

To specify .jar files to dynamically load into the host JVM see the [jarfiles](https://doc.log10x.com/run/bootstrap/#jarfiles) argument.

## :fontawesome-brands-java: OutputStream

The [I/O Streams](https://docs.oracle.com/javase/tutorial/essential/io/streams.html){target="\_blank"} integration enables [outputs](https://doc.log10x.com/run/output/event) to 
write TenXObject instance values to arbitrary destinations via custom [OutputStream](https://www.baeldung.com/java-outputstream){target="\_blank"}  and [Writer](https://docs.oracle.com/en%2Fjava%2Fjavase%2F11%2Fdocs%2Fapi%2F%2F/java.base/java/io/Writer.html){target="\_blank"}  classes.

:simple-yaml: Config example: [process/stream.yaml](https://github.com/log-10x/config/blob/main/pipelines/run/modules/output/event/process/stream.yaml){target="\_blank"}.

:fontawesome-brands-java: Code example: `ProcOutputStream.java`.

## :material-math-log: Log4j2

The [Log4j2](https://logging.apache.org/log4j/2.x/manual/appenders.html){target="\_blank"} integration enables [appender](https://doc.log10x.com/run/output/event/) outputs to emit TenXObject instance values to an extensible selection of local and remote event outputs.

The 10x Engine integrates with log4j2 framework because of its wide ecosystem, high level of configurability and [performance](https://logging.apache.org/log4j/2.3.x/performance.html).
TenXObjects implement the [Message](https://logging.apache.org/log4j/2.x/manual/messages.html) interface, making them 1st class citizens within the log4j2 ecosystem.

The 10x Engine provides custom log4j2 plugins that enable access to the [10x JavaScript API](/api/js/) from within log4j2 configuration files, allowing dynamic field extraction, filtering, and formatting of TenXObjects during output.

=== ":material-code-braces: eval"

    The `eval` [lookup](https://logging.apache.org/log4j/2.x/manual/lookups.html) plugin evaluates [10x JavaScript](/api/js/) expressions against the current TenXObject being logged.

    **Plugin Name:** `eval`

    **Usage in log4j2.yaml:**

    ```yaml
    patternLayout:
      pattern: "%msg ${eval:this.get('level')} ${eval:this.get('source')}%n"
    ```

    This allows dynamic field extraction from TenXObjects during log output formatting.

    :fontawesome-brands-java: Source: `EvaluatorLookup.java`

=== ":material-filter-outline: tenxFilter"

    The `tenxFilter` plugin [filters](https://logging.apache.org/log4j/2.x/manual/filters.html) log events based on 10x JavaScript expressions evaluated against the target TenXObject.

    **Plugin Name:** `tenxFilter`

    **Usage in log4j2.yaml:**

    ```yaml
    appenders:
      rollingFile:
        - name: filteredAppender
          tenxFilter:
            expression: "this.get('level') == 'ERROR'"
            onMatch: ACCEPT
            onMismatch: DENY
    ```

    :fontawesome-brands-java: Source: `ExpressionFilter.java`

=== ":material-table: tenxFields"

    The `tenxFields` plugin provides programmatic access to TenXObject field values via a [function](https://www.baeldung.com/java-8-functional-interfaces#Functions) interface. It returns a map of field name/value pairs.

    **Plugin Name:** `tenxFields`

    **Attributes:**

    | Attribute | Description |
    |-----------|-------------|
    | `fieldNames` | Comma-separated list of field names to extract (e.g., `"text,vars,price"`) |

    :fontawesome-brands-java: Source: `FieldValuesAccessor.java`

=== ":material-tag-outline: tag"

    The `tag` plugin accesses the TenXObject's [source tag](/run/input/stream/#inputsourcepattern) value.

    **Plugin Name:** `tag`

    **Attributes:**

    | Attribute | Description |
    |-----------|-------------|
    | `tagField` | Optional fallback field name if the object is not tagged |

=== ":material-format-columns: tenxLayout"

    The `tenxLayout` plugin serializes TenXObjects and template values to core/3rd-party [appenders](https://logging.apache.org/log4j/2.x/manual/appenders.html) with configurable field selection and filtering.

    **Plugin Name:** `tenxLayout`

    **Attributes:**

    | Attribute | Description |
    |-----------|-------------|
    | `encodedFields` | Fields to include in output (from `outputFileFields`) |
    | `filter` | 10x JavaScript expression to filter objects (from `outputFileFilter`) |

    **Example usage** in [file output log4j2.yaml](https://github.com/log-10x/config/blob/main/modules/pipelines/run/modules/output/event/file/log4j2.yaml):

    ```yaml
    appenders:
      file:
        - name: $loggerName
          tenxLayout:
            encodedFields: null
            filter: null
          fileName: $outputFilePath
          createOnDemand: true
    ```

    See [File Output](/run/output/event/file/) for configuration details.

    :fontawesome-brands-java: Source: `EncodeFieldsLayout.java`

:simple-yaml: Config example: [forward/log4j2.yaml](https://github.com/log-10x/config/blob/main/pipelines/run/modules/output/event/forward/log4j2.yaml){target="_blank"}

## :octicons-graph-24: Micrometer

The [Micrometer](https://micrometer.io/){target="\_blank"} integration enables [time-series](https://doc.log10x.com/run/output/metric/#extensions) outputs to publish [aggregated](https://doc.log10x.com/run/aggregate/) TenXSummary instance values to an extensible array of time-series DBs (e.g., Datadog, Prometheus).                                              

To support additional output destinations, define custom `registries`.

:simple-yaml: Config example: [datadog/stream.yaml](https://github.com/log-10x/config/blob/main/pipelines/run/modules/output/metric/datadog/stream.yaml){target="\_blank"}.

:fontawesome-brands-java: Code example: `DataDogMetricRegistryFactory.java`.

