From 2123ebb5358df29064d07626013b213212d506d6 Mon Sep 17 00:00:00 2001 From: Vedarth Sharma Date: Fri, 28 Feb 2025 14:53:55 +0530 Subject: [PATCH 1/3] Adds a usage guide for StructuredJsonLayout log4j2 plugin --- log4j2-extensions/README.md | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 log4j2-extensions/README.md diff --git a/log4j2-extensions/README.md b/log4j2-extensions/README.md new file mode 100644 index 00000000000..22311ec4cca --- /dev/null +++ b/log4j2-extensions/README.md @@ -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 + + io.confluent + log4j2-extensions + +``` + +## 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 +``` From 75c44d28b678ba5cabcfef89a6ffbd99e69e43d3 Mon Sep 17 00:00:00 2001 From: Vedarth Sharma Date: Fri, 28 Feb 2025 14:57:29 +0530 Subject: [PATCH 2/3] Fix artifact id --- log4j2-extensions/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log4j2-extensions/README.md b/log4j2-extensions/README.md index 22311ec4cca..2c24d3191b6 100644 --- a/log4j2-extensions/README.md +++ b/log4j2-extensions/README.md @@ -10,7 +10,7 @@ Ensure you have the `log4j2-extensions` dependency included in your project. Add ```xml io.confluent - log4j2-extensions + confluent-log4j2-extensions ``` From 0ea0c0d1c4859357cf8a36f1d3f6a571c6c22fd7 Mon Sep 17 00:00:00 2001 From: Vedarth Sharma Date: Fri, 28 Feb 2025 16:07:59 +0530 Subject: [PATCH 3/3] Resolve comments --- log4j2-extensions/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log4j2-extensions/README.md b/log4j2-extensions/README.md index 2c24d3191b6..ecfbfe9ec91 100644 --- a/log4j2-extensions/README.md +++ b/log4j2-extensions/README.md @@ -38,7 +38,7 @@ Configuration: - ref: Console ``` -If you are using `SerializableSchemaAndValue`, then the following properties can be provided to `StructuredJsonLayout` to migrate to log4j2:- +If you are using `SerializableSchemaAndValue`, then the following properties can be provided to `StructuredJsonLayout` to migrate to log4j2: ```yaml StructuredJsonLayout: