You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2014/02/27 23:41:46 UTC

Config styles

I just saw a commit for YAML config.

Can we review what Simone T. did a while back in the area of configuration?

@Simone: Can you give an overview?

Thank you,
Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Config styles

Posted by Simone Tripodi <si...@apache.org>.
Hi all mates,
long time without chatting :)

my proposal would have had more sense at the time I proposed it, but at
that current stage where you have XML, JSON and YAML and you are satisfied
with them, it doesn't make anymore sense.

Modello approach is fine because XML|JSON|YAML Readers|Writers are
generated without writing any single line of code - when upgrading the
model, developers need to regenerate them without maintaining
(un)marshallers by hand

Take in consideration Modello would have helped you on keeping the
configuration less structured - both current log4j JSON/YAML could have
been modeled in a less verbose format.

Best,
-Simo


http://people.apache.org/~simonetripodi/
http://twitter.com/simonetripodi


On Fri, Feb 28, 2014 at 2:32 AM, Gary Gregory <ga...@gmail.com>wrote:

> On Thu, Feb 27, 2014 at 6:59 PM, Ralph Goers <ra...@dslextreme.com>wrote:
>
>> First, my initial goal was to make it so that you could use the core
>> features of Log4j 2 with no third party dependencies. I am not sure if that
>> is true any more but I see no reason to introduce one for configuration.
>>
>> Second, I don’t really see what benefit we would be getting. Perhaps that
>> is because in the links Simone provided I don’t see anything that ties to
>> the configuration he is manipulating back into Log4j
>>
>> Third, the algorithm used in parsing the configuration is really simple -
>> the configuration is converted into a Node tree. BaseConfiguration then
>> processes the Node tree to create the actual configuration.  So if you want
>> to create a new configuration type all you have to do is make sure that
>> when it is done a proper Node tree is constructed.
>>
>> If I wanted to create a configuration based on Groovy or bean shell I
>> know exactly what would need to be done.  I have no idea how that could be
>> accomplished using modello.
>>
>> In short, nothing I’ve seen yet has convinced me that there is anything
>> to gain by switching.
>>
>
> OK, thanks for the clarifications.
>
> I'm curious to see if Simone can explain the pros and cons of his system.
>
> Gary
>
>
>>
>> Ralph
>>
>> On Feb 27, 2014, at 2:41 PM, Gary Gregory <ga...@gmail.com> wrote:
>>
>> I just saw a commit for YAML config.
>>
>> Can we review what Simone T. did a while back in the area of
>> configuration?
>>
>> @Simone: Can you give an overview?
>>
>> Thank you,
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

Re: Config styles

Posted by Matt Sicker <bo...@gmail.com>.
And one of the awesome side effects of Ralph's config system is that it
also makes it easy to expose different ways to specify a configuration
outside of log4j-core. For instance, one of the OSGi features I'll be
adding down the road are various ways to configure log4j using standard
OSGi configuration services like managed services and preferences (which is
rather similar to java.util.prefs honestly). I haven't looked at the JMX
code yet, but it works using a similar concept, right?


On 27 February 2014 19:32, Gary Gregory <ga...@gmail.com> wrote:

> On Thu, Feb 27, 2014 at 6:59 PM, Ralph Goers <ra...@dslextreme.com>wrote:
>
>> First, my initial goal was to make it so that you could use the core
>> features of Log4j 2 with no third party dependencies. I am not sure if that
>> is true any more but I see no reason to introduce one for configuration.
>>
>> Second, I don’t really see what benefit we would be getting. Perhaps that
>> is because in the links Simone provided I don’t see anything that ties to
>> the configuration he is manipulating back into Log4j
>>
>> Third, the algorithm used in parsing the configuration is really simple -
>> the configuration is converted into a Node tree. BaseConfiguration then
>> processes the Node tree to create the actual configuration.  So if you want
>> to create a new configuration type all you have to do is make sure that
>> when it is done a proper Node tree is constructed.
>>
>> If I wanted to create a configuration based on Groovy or bean shell I
>> know exactly what would need to be done.  I have no idea how that could be
>> accomplished using modello.
>>
>> In short, nothing I’ve seen yet has convinced me that there is anything
>> to gain by switching.
>>
>
> OK, thanks for the clarifications.
>
> I'm curious to see if Simone can explain the pros and cons of his system.
>
> Gary
>
>
>>
>> Ralph
>>
>> On Feb 27, 2014, at 2:41 PM, Gary Gregory <ga...@gmail.com> wrote:
>>
>> I just saw a commit for YAML config.
>>
>> Can we review what Simone T. did a while back in the area of
>> configuration?
>>
>> @Simone: Can you give an overview?
>>
>> Thank you,
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Config styles

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Feb 27, 2014 at 6:59 PM, Ralph Goers <ra...@dslextreme.com>wrote:

> First, my initial goal was to make it so that you could use the core
> features of Log4j 2 with no third party dependencies. I am not sure if that
> is true any more but I see no reason to introduce one for configuration.
>
> Second, I don’t really see what benefit we would be getting. Perhaps that
> is because in the links Simone provided I don’t see anything that ties to
> the configuration he is manipulating back into Log4j
>
> Third, the algorithm used in parsing the configuration is really simple -
> the configuration is converted into a Node tree. BaseConfiguration then
> processes the Node tree to create the actual configuration.  So if you want
> to create a new configuration type all you have to do is make sure that
> when it is done a proper Node tree is constructed.
>
> If I wanted to create a configuration based on Groovy or bean shell I know
> exactly what would need to be done.  I have no idea how that could be
> accomplished using modello.
>
> In short, nothing I’ve seen yet has convinced me that there is anything to
> gain by switching.
>

OK, thanks for the clarifications.

I'm curious to see if Simone can explain the pros and cons of his system.

Gary


>
> Ralph
>
> On Feb 27, 2014, at 2:41 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> I just saw a commit for YAML config.
>
> Can we review what Simone T. did a while back in the area of configuration?
>
> @Simone: Can you give an overview?
>
> Thank you,
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Config styles

Posted by Ralph Goers <ra...@dslextreme.com>.
First, my initial goal was to make it so that you could use the core features of Log4j 2 with no third party dependencies. I am not sure if that is true any more but I see no reason to introduce one for configuration. 

Second, I don’t really see what benefit we would be getting. Perhaps that is because in the links Simone provided I don’t see anything that ties to the configuration he is manipulating back into Log4j 

Third, the algorithm used in parsing the configuration is really simple - the configuration is converted into a Node tree. BaseConfiguration then processes the Node tree to create the actual configuration.  So if you want to create a new configuration type all you have to do is make sure that when it is done a proper Node tree is constructed.  

If I wanted to create a configuration based on Groovy or bean shell I know exactly what would need to be done.  I have no idea how that could be accomplished using modello.

In short, nothing I’ve seen yet has convinced me that there is anything to gain by switching.

Ralph

On Feb 27, 2014, at 2:41 PM, Gary Gregory <ga...@gmail.com> wrote:

> I just saw a commit for YAML config.
> 
> Can we review what Simone T. did a while back in the area of configuration?
> 
> @Simone: Can you give an overview?
> 
> Thank you,
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory