[logback-dev] [discuss] a new (prototypal) approach to Joran configuration

ceki ceki at qos.ch
Fri Jun 21 10:50:11 CEST 2013


On 21.06.2013 10:20, Simone Tripodi wrote:
> Hi Ceki!
>
> On Thu, Jun 20, 2013 at 11:13 PM, ceki <ceki at qos.ch> wrote:
>> On 20.06.2013 09:44, Simone Tripodi wrote:
>>>
>>> Hi Ceki/all!
>>>
>>> due to my recent involvement in Modello[1], I started experimenting
>>> how the Modello approach could benefit existing projects that require
>>> to parse XML (but also JSON and YAML) configurations, and took Logback
>>> as a good example where doing some experiments...
>>>
>>> What made me curious to made that experiment, is the fact that current
>>> Joran approach is based to SAX APIs + reflection - elements are
>>> introspected at runtime and components will be injected - while the
>>> Modello approach is based on streaming APIs and introspection analysis
>>> is performed at compile-time, generating the "parse-tree" and the
>>> (un)marshallers.
>>
>>
>> Is there introspection support in Modello?
>>
>
> Nope, unfortunately :( it generates readers/writers that just invoke
> plain old setters/getters/adders for generated models, but that is why
> maybe is efficient.

How does Modello know what setters and getters to generate? Do you
have to manually specify each setter and getter to generate? There
must be some automation because AFAIK Maven uses Modello for reading
pom.xml, and Maven can inject parameters specificied in the pom into
Mojos...

[snip]

> may I can kindly ask you to point me to the current XML schema for
> Joran configuration? Once complete, I think you could evaluate an
> experimental Joran2 module - which can co-live nicely with existing
> Joran...


Currently there is no XSD for Joran. Creating one is on my to do
list. Moreover, the fact that Modello can create the XSD from the
Model is one of the reasons I am interested in Modello.

For logback-classic, the "spec" is "defined" by the rules defined in
[1] and [2]. Whenever Joran sees an XML element for which there is no
defined rule, it attempts to apply the implicit injection rule. The
implicit injection rule tries to inject value of the the current XML
element into the latest instantiated logback component.

I've got a train to catch. More later.


[1] http://tinyurl.com/JoranConfiguratorBase
[2] http://tinyurl.com/JoranConfigurator

> All the best,
> -Simo
>
> http://people.apache.org/~simonetripodi/
> http://twitter.com/simonetripodi
> _______________________________________________
> logback-dev mailing list
> logback-dev at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-dev
>


-- 
Ceki
65% of statistics are made up on the spot


More information about the logback-dev mailing list