[slf4j-user] FYI - structured logging wrapper for SLF4J

Matt Sicker boards at gmail.com
Wed Oct 2 02:43:04 CEST 2019


This sounds vaguely like Log4j Audit, but with a more fluent API. Sounds
neat!

On Tue, Oct 1, 2019 at 16:19, Jordan Zimmerman <jordan at jordanzimmerman.com>
wrote:

> because then you can use that S.fluent().call().chain() code in other
> contexts
>
>
> I see. You can actually decouple, though it might need a bit more work
> depending on what you need. For example, the lambda can be defined
> independently. E.g.
>
> Statement<Schema> s = s -> s.name(foo).age(bar);
>
> This statement can then be re-used and even extended. There's an example
> here -
> https://github.com/Randgalt/maple/blob/master/maple-examples/src/main/java/com/myco/app/request/UpdateService.java
> .
>
> Maple has a bunch on internal utils that could be useful outside of
> logging. For example, you can convert a statement lambda into a list of
> Names/Values via the MapleSpi factory. E.g.
>
> // save this meta instance somewhere
> var metaIInstance = MapleSpi.instance().generate(Schema.class);
>
> // convert a statement into names/values
> var instance = metaInstance.newSchemaInstance();
> s.handle(instance);
> var namesValues = metaIInstance.toNamesValues(instance);
>
> If this became a desired idiom I could make a little utility for this bit.
>
> OT3H I may be moving towards log4j2 in the next months anyway
>
>
> FWIW - I wrote Maple in an implementation neutral way. It would be very
> easy to add a direct Log4J2 backend for it. Just a few classes to implement.
>
> -JZ
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user

-- 
Matt Sicker <boards at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20191001/95ed56df/attachment-0001.html>


More information about the slf4j-user mailing list