Skip to content

Created Provider that receives logEntry to provide parameters

Matthias Benkard requested to merge github/fork/cleciusjm/master into master

Created by: cleciusjm

Add ParametrizedStructuredParameterProvider to provide way do get contextualized params

with this interface some params can be generated base in Log entry, like loggerName param

This allow usage like this sample:

@Singleton
@Unremovable
public class LogCustomizer implements ParametrizedStructuredParameterProvider {

    @Override
    public StructuredParameter getParameter(ExtLogRecord logEntry) {
        var b = createObjectBuilder()
                .add("thread", currentThread().getName())
                .add("logger", logEntry.getLoggerName());
        return () -> b;
    }

}

Merge request reports

Loading