Extensible Log4j2 JSON Layout

Extend Log4j2 JSON layout with custom fields

Лицензия

Лицензия

Категории

Категории

JSON Данные
Группа

Группа

org.crosslibs
Идентификатор

Идентификатор

extensible-json-layout
Последняя версия

Последняя версия

2.9.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Extensible Log4j2 JSON Layout
Extend Log4j2 JSON layout with custom fields
Ссылка на сайт

Ссылка на сайт

https://github.com/cpdevws/extensible-json-layout
Система контроля версий

Система контроля версий

https://github.com/cpdevws/extensible-json-layout/tree/master

Скачать extensible-json-layout

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.crosslibs/extensible-json-layout/ -->
<dependency>
    <groupId>org.crosslibs</groupId>
    <artifactId>extensible-json-layout</artifactId>
    <version>2.9.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.crosslibs/extensible-json-layout/
implementation 'org.crosslibs:extensible-json-layout:2.9.0'
// https://jarcasting.com/artifacts/org.crosslibs/extensible-json-layout/
implementation ("org.crosslibs:extensible-json-layout:2.9.0")
'org.crosslibs:extensible-json-layout:jar:2.9.0'
<dependency org="org.crosslibs" name="extensible-json-layout" rev="2.9.0">
  <artifact name="extensible-json-layout" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.crosslibs', module='extensible-json-layout', version='2.9.0')
)
libraryDependencies += "org.crosslibs" % "extensible-json-layout" % "2.9.0"
[org.crosslibs/extensible-json-layout "2.9.0"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.apache.logging.log4j : log4j jar 2.9.0
org.apache.logging.log4j : log4j-api jar 2.9.0
org.apache.logging.log4j : log4j-core jar 2.9.0
com.fasterxml.jackson.core : jackson-databind jar 2.9.1

test (3)

Идентификатор библиотеки Тип Версия
org.apache.logging.log4j : log4j-api jar 2.9.0
org.apache.logging.log4j : log4j-core jar 2.9.0
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Extensible Log4j2 Json Layout

Build Status

Extensible Log4j2 JSON Layout (extensible-json-layout) provides the ability to add custom attributes to the JSON logs.

How to use

In your log4j2 configuration file (log4j2.xml, log4j2.yml, log4j2.yaml or log4j2.json), please use ExtensibleJsonLayout instead of JsonLayout. Please note that all configuration properties of JsonLayout are supported by ExtensibleJsonLayout.

In addition, you may inject custom JSON properties into your code by passing the configuration property adapter in <ExtensibleJsonLayout />

1. Example log4j2.xml snippet with configuration set to defaults:
    <Appenders>
        <Console name="Console-Appender" target="SYSTEM_OUT">
            <ExtensibleJsonLayout />
            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
        </Console>
    </Appenders>
2. Example log4j2.xml snippet with custom log adapter:
    <Appenders>
        <Console name="Console-Appender" target="SYSTEM_OUT">
            <ExtensibleJsonLayout adapter="org.crosslibs.extensible.json.layout.Adapter" />
            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
        </Console>
    </Appenders>

Build Configuration

Gradle

If you are using gradle, please include the following snippet into your build.gradle file

buildScript {
    ext {
        log4j2Version = '2.9.0'
    }
}

dependencies {
  compile group: 'org.crosslibs', artifact: 'extensible-json-layout', version: log4jVersion
}

Maven

If you are using maven, please include the following snippet into your pom.xml file

<properties>
    <log4j2.version>2.9.0</log4j2.version>
</properties>

<dependency>
    <groupId>org.crosslibs</groupId>
    <arifactId>extensible-json-layout</artifactId>
    <version>${log4j2.version}</version>
</dependency>

Contact

In case of any questions or feedback, please reach out to Chaitanya Prakash N or log an issue.

Pull requests welcome.

Версии библиотеки

Версия
2.9.0