Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions log4j2-extensions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
StructuredJsonLayout Plugin Usage Guide
=======================================

This guide provides instructions on how to use the `StructuredJsonLayout` plugin in a Log4j2 YAML configuration file.

## Prerequisites

Ensure you have the `log4j2-extensions` dependency included in your project. Add the following to your `pom.xml` if you are using Maven:

```xml
<dependency>
<groupId>io.confluent</groupId>
<artifactId>confluent-log4j2-extensions</artifactId>
</dependency>
```

## Configuration

Below is an example of how to configure the StructuredJsonLayout plugin in a Log4j2 YAML configuration file

```yaml
Configuration:
status: warn
appenders:
console:
name: Console
target: SYSTEM_OUT
StructuredJsonLayout:
Property:
- name: "property1"
value: "value1"
- name: "property2"
value: "value2"
loggers:
root:
level: info
appenderRefs:
- ref: Console
```

If you are using `SerializableSchemaAndValue`, then the following properties can be provided to `StructuredJsonLayout` to migrate to log4j2:-

```yaml
StructuredJsonLayout:
Property:
- name: schemas.enable
value: false
```