flogger-parent

Flogger Parent

Лицензия

Лицензия

Группа

Группа

com.jahnelgroup.flogger
Идентификатор

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

flogger-parent
Последняя версия

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

2.0.0
Дата

Дата

Тип

Тип

pom
Описание

Описание

flogger-parent
Flogger Parent
Ссылка на сайт

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

https://github.com/JahnelGroup/flogger
Система контроля версий

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

https://github.com/JahnelGroup/flogger/tree/master

Скачать flogger-parent

Имя Файла Размер
flogger-parent-2.0.0.pom 7 KB
Обзор

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

<!-- https://jarcasting.com/artifacts/com.jahnelgroup.flogger/flogger-parent/ -->
<dependency>
    <groupId>com.jahnelgroup.flogger</groupId>
    <artifactId>flogger-parent</artifactId>
    <version>2.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.jahnelgroup.flogger/flogger-parent/
implementation 'com.jahnelgroup.flogger:flogger-parent:2.0.0'
// https://jarcasting.com/artifacts/com.jahnelgroup.flogger/flogger-parent/
implementation ("com.jahnelgroup.flogger:flogger-parent:2.0.0")
'com.jahnelgroup.flogger:flogger-parent:pom:2.0.0'
<dependency org="com.jahnelgroup.flogger" name="flogger-parent" rev="2.0.0">
  <artifact name="flogger-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.jahnelgroup.flogger', module='flogger-parent', version='2.0.0')
)
libraryDependencies += "com.jahnelgroup.flogger" % "flogger-parent" % "2.0.0"
[com.jahnelgroup.flogger/flogger-parent "2.0.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.aspectj : aspectjweaver jar 1.8.13
org.slf4j : slf4j-api jar 1.7.25

runtime (1)

Идентификатор библиотеки Тип Версия
org.aspectj : aspectjrt jar 1.8.13

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

  • flogger-core
  • flogger-spring-boot

Flogger

Build Status

Whip your logs into shape!

Flogger is an AspectJ library that provides the ability to easily add information to the MDC.

Table of Contents

Install

Spring Boot

Adding Flogger to a Spring Boot project is as simple as adding a dependency to flogger-spring-boot.

<dependency>
    <groupId>com.jahnelgroup.flogger</groupId>
    <artifactId>flogger-spring-boot</artifactId>
    <version>2.0.0</version>
</dependency>

Java 8

Flogger can also be used in plain Java projects using the aspectj-maven-plugin.

flogger-sample is an example project showing how to set it up.

Usage

To add method parameters to the MDC, annotate them with @BindParam.

To add the return value of a method to the MDC, annotate the method with @BindReturn.

The key in the MDC can be customized by the value field on both annotations.

Expansion

You can expand an object before it gets added to the MDC by setting expand=true in the annotations.

This will add the object's field values and method return values (only methods that take 0 parameters) to the MDC instead of calling .toString() on the object.

By default, every field and method on the object will be added to the MDC. This can be customized similar to Lombok's @EqualsAndHashCode.

To exclude a field/method, annotate it with @BindExpand.Exclude.

You can specify exactly which fields/methods are to be added to the MDC by annotating the object's class with @BindExpand(onlyExplicityIncluded=true) and then each method/field you wish to add with @BindExpand.Include.

The key in the MDC for expanded fields/methods can be customized by the value field on @BindExpand.Include.

Example

public class Expanded {
    
    private String field = "field"

    private String method() {
        return "method";    
    }
    
    public String toString() {
        return "expanded.toString()";
    }
}

...

public void method(@BindParam(expand=?) Expanded expanded) {...}

When expand=false the MDC contains :

{expanded=expanded.toString()}

When expand=true the MDC contains:

{field=field, method=method, toString=expanded.toString()}

License

MIT © Jahnel Group

com.jahnelgroup.flogger

Jahnel Group

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

Версия
2.0.0
1.4.0
1.3.0