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 Christian Grobmeier <gr...@gmail.com> on 2012/12/06 15:09:56 UTC
[v2] Where to put appenders with dependency?
Hi,
lets say we would write an SMTPAppender. It would need dependencies to
some mail framework. If you write an MongoDB Appender you wuold have
dependencies to the Mongo-Connector.
Both dependencies should not come with log4j2 because most people
would not need them. Now my first idea was to create a new artifact
like:
<groupId>org.apache.logging.log4j.extensions</groupId>
<artifactId>log4j-smtp</artifactId>
They could inherit the log4j parent and put into the directory as submodules.
But I believe it might be beneficial to create a separate repository,
lets say log4j2-extensions and maintain them in some way like Apache
Commons or Apache Onami, as independent artifacts with independent
release cycle.
If we would do that, we could have a Sandbox and a Proper folder.
Sandbox could be opened to every ASF committer. I imagine there are a
few people who might want to contribute their things. I know a few
people who maintain some log4j1 related stuff, like osgi-log4j in
Apache Sling or I think in Hadoop is something similar (log4j Hadoop
appender)
Any thoughts?
Cheers
Christian
--
http://www.grobmeier.de
https://www.timeandbill.de
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: [v2] Where to put appenders with dependency?
Posted by Ralph Goers <ra...@dslextreme.com>.
Unlike Gary, I dislike the all-in-one approach. With the Mongo example I would prefer to be able to just add a dependency in my pom for that artifact and have it bring in the transitive dependencies it needs. I don't want to manually have to figure out what I need, which is what will happen if the appender's dependencies are marked as provided or optional.
That said, I'm not sure I like the idea of having a "Proper" folder. Maybe that is just because I've always thought that was a very odd name. But when I added the samples everyone was in favor of just adding them to trunk. I'm not sure why these new components wouldn't reside with the other "adapters", unless they are of sandbox quality.
I think a sandbox open to ASF committers is a good idea.
Ralph
On Dec 6, 2012, at 6:09 AM, Christian Grobmeier wrote:
> Hi,
>
> lets say we would write an SMTPAppender. It would need dependencies to
> some mail framework. If you write an MongoDB Appender you wuold have
> dependencies to the Mongo-Connector.
>
> Both dependencies should not come with log4j2 because most people
> would not need them. Now my first idea was to create a new artifact
> like:
>
> <groupId>org.apache.logging.log4j.extensions</groupId>
> <artifactId>log4j-smtp</artifactId>
>
> They could inherit the log4j parent and put into the directory as submodules.
>
> But I believe it might be beneficial to create a separate repository,
> lets say log4j2-extensions and maintain them in some way like Apache
> Commons or Apache Onami, as independent artifacts with independent
> release cycle.
>
> If we would do that, we could have a Sandbox and a Proper folder.
> Sandbox could be opened to every ASF committer. I imagine there are a
> few people who might want to contribute their things. I know a few
> people who maintain some log4j1 related stuff, like osgi-log4j in
> Apache Sling or I think in Hadoop is something similar (log4j Hadoop
> appender)
>
> Any thoughts?
>
> Cheers
> Christian
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: [v2] Where to put appenders with dependency?
Posted by Jacob Kjome <ho...@visi.com>.
On Thu, 6 Dec 2012 15:35:58 +0100
Christian Grobmeier <gr...@gmail.com> wrote:
>>
>> I think there is a concept in Ivy and Maven that a dependency is provided
> by
>> a container.
>
> Oh yes, there is:
>
> <dependency>
> <groupId>org.testng</groupId>
> <artifactId>testng</artifactId>
> *<scope>provided</scope>*
> </dependency>
>
> We would need to "solve" that with good docs then. People need to know what
> to include for specific appenders.
>
This is a bad example. For test artifacts that would never be deployed
dependency of another application, you'd use...
<scope>test</scope>
If you were depending on, say..., the servlet API, you could use the
"provided" scope to prevent it from being a transitive dependency of dependent
applications (since it would be provided by the container anyway), yet still
have the servlet API automatically downloaded from the repository for
compilation of the current application.
See...
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
Furthermore, for dependencies where you want to avoid transitive dependence,
but where the dependency would not necessarily be provided by the container,
you can use...
<optional>true</optional>
Seems like this would be appropriate for a dependency upon "mongoDB". While
it might be provided by a container (if a user placed it in a global lib
directory), there's no specification saying that JEE containers must provide
"mongoDB" APIs. Furthermore, even if a user chooses to use an SMTP appender
which might be in the same jar as a "mongoDB" appender, they shouldn't be
unnecessarily forced to depend upon "mongoDB".
See...
http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
In any case, it seems to me that separate jars should be the norm. An
uber-jar can be created for those that want one. But having an "all" jar be
the only option simply repeats the mistake of Log4j1. That jar is nearly 500k
because it includes chainsaw1 and lf5, which almost no one uses at runtime.
Without those, it would be closer to 300k (and I'm sure there's some other
bloat that could be gotten rid).
I'm all for an uber-jar that is created by merging the standard jars with
minimal dependencies. But I'm not for the case where everyone is forced to
deploy a bunch of cruft that they'll never use. A user should have the choice
to deploy the minimum set up libraries that suit their needs.
I'd say we could have a "log4j-extensions" jar with more than just one
extension. It could either contain all extensions or we could have one jar
per group of extensions. Maybe one for database-related extensions and
another for purely network-protocol-based extensions. I have no strong
feelings on this, just a suggestion.
Jake
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: [v2] Where to put appenders with dependency?
Posted by Christian Grobmeier <gr...@gmail.com>.
On Thu, Dec 6, 2012 at 3:33 PM, Gary Gregory <ga...@gmail.com> wrote:
> On Thu, Dec 6, 2012 at 9:30 AM, Christian Grobmeier <gr...@gmail.com>
> wrote:
>>
>> On Thu, Dec 6, 2012 at 3:21 PM, Gary Gregory <ga...@gmail.com>
>> wrote:
>> > Hi All:
>> >
>> > Please do not make it more complicated than it already is. I profoundly
>> > dislike having to deal with projects that decide for me that I need to
>> > reference an API, core, foo and bar jar, and one more jar for this and
>> > another for that. I don't care, it's a hassle. Just give me an "all"
jar
>> > file (like CXF and Jetty give you the option to use). If I have to dig
>> > around for yet another Spring jar, I'm going to smash a pumpkin. At
>> > run-time, if you do not load a class, the deps are not needed. At
>> > compile
>> > time, yes, you need the API deps, but Maven takes care of that for us.
>>
>> If you make a webapp with the mongo-db appender in it, you have that
>> lib ready and waiting for you in the libs folder. Even if you don't
>> need it. That not the problem. But what if i want to use a different
>> version of mongodb-connector? Do I end up with 2 mongo-db connectors
>> in the lib folders? Which one is taken?
>>
>> This case is often happening in log4j1 world, where people need to
>> write exclude statements for jars which are provided by the container.
>> While I like to keep things easy, I am not so sure we should put each
>> and every appender and depenencies into the project at compile time.
>>
>> Maybe there is an option to make dependencies like mongodb-connector
>> "provided"- then it would not be delivered, the user would need to
>> take to create this dependency himself, if he wants to use the mongodb
>> appender.
>
>
> I think there is a concept in Ivy and Maven that a dependency is provided
by
> a container.
Oh yes, there is:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
*<scope>provided</scope>*
</dependency>
We would need to "solve" that with good docs then. People need to know what
to include for specific appenders.
> Gary
>
>>
>>
>> Cheers
>>
>>
>>
>> > Gary
>> >
>> >
>> > On Thu, Dec 6, 2012 at 9:09 AM, Christian Grobmeier
>> > <gr...@gmail.com>
>> > wrote:
>> >>
>> >> Hi,
>> >>
>> >> lets say we would write an SMTPAppender. It would need dependencies to
>> >> some mail framework. If you write an MongoDB Appender you wuold have
>> >> dependencies to the Mongo-Connector.
>> >>
>> >> Both dependencies should not come with log4j2 because most people
>> >> would not need them. Now my first idea was to create a new artifact
>> >> like:
>> >>
>> >> <groupId>org.apache.logging.log4j.extensions</groupId>
>> >> <artifactId>log4j-smtp</artifactId>
>> >>
>> >> They could inherit the log4j parent and put into the directory as
>> >> submodules.
>> >>
>> >> But I believe it might be beneficial to create a separate repository,
>> >> lets say log4j2-extensions and maintain them in some way like Apache
>> >> Commons or Apache Onami, as independent artifacts with independent
>> >> release cycle.
>> >>
>> >> If we would do that, we could have a Sandbox and a Proper folder.
>> >> Sandbox could be opened to every ASF committer. I imagine there are a
>> >> few people who might want to contribute their things. I know a few
>> >> people who maintain some log4j1 related stuff, like osgi-log4j in
>> >> Apache Sling or I think in Hadoop is something similar (log4j Hadoop
>> >> appender)
>> >>
>> >> Any thoughts?
>> >>
>> >> Cheers
>> >> Christian
>> >>
>> >> --
>> >> http://www.grobmeier.de
>> >> https://www.timeandbill.de
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> >> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>> >>
>> >
>> >
>> >
>> > --
>> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> > JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
>> > Spring Batch in Action: http://bit.ly/bqpbCK
>> > Blog: http://garygregory.wordpress.com
>> > Home: http://garygregory.com/
>> > Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>> --
>> http://www.grobmeier.de
>> https://www.timeandbill.de
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
> Spring Batch in Action: http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
--
http://www.grobmeier.de
https://www.timeandbill.de
Re: [v2] Where to put appenders with dependency?
Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Dec 6, 2012 at 9:30 AM, Christian Grobmeier <gr...@gmail.com>wrote:
> On Thu, Dec 6, 2012 at 3:21 PM, Gary Gregory <ga...@gmail.com>
> wrote:
> > Hi All:
> >
> > Please do not make it more complicated than it already is. I profoundly
> > dislike having to deal with projects that decide for me that I need to
> > reference an API, core, foo and bar jar, and one more jar for this and
> > another for that. I don't care, it's a hassle. Just give me an "all" jar
> > file (like CXF and Jetty give you the option to use). If I have to dig
> > around for yet another Spring jar, I'm going to smash a pumpkin. At
> > run-time, if you do not load a class, the deps are not needed. At compile
> > time, yes, you need the API deps, but Maven takes care of that for us.
>
> If you make a webapp with the mongo-db appender in it, you have that
> lib ready and waiting for you in the libs folder. Even if you don't
> need it. That not the problem. But what if i want to use a different
> version of mongodb-connector? Do I end up with 2 mongo-db connectors
> in the lib folders? Which one is taken?
>
> This case is often happening in log4j1 world, where people need to
> write exclude statements for jars which are provided by the container.
> While I like to keep things easy, I am not so sure we should put each
> and every appender and depenencies into the project at compile time.
>
> Maybe there is an option to make dependencies like mongodb-connector
> "provided"- then it would not be delivered, the user would need to
> take to create this dependency himself, if he wants to use the mongodb
> appender.
>
I think there is a concept in Ivy and Maven that a dependency is provided
by a container.
Gary
>
> Cheers
>
>
>
> > Gary
> >
> >
> > On Thu, Dec 6, 2012 at 9:09 AM, Christian Grobmeier <grobmeier@gmail.com
> >
> > wrote:
> >>
> >> Hi,
> >>
> >> lets say we would write an SMTPAppender. It would need dependencies to
> >> some mail framework. If you write an MongoDB Appender you wuold have
> >> dependencies to the Mongo-Connector.
> >>
> >> Both dependencies should not come with log4j2 because most people
> >> would not need them. Now my first idea was to create a new artifact
> >> like:
> >>
> >> <groupId>org.apache.logging.log4j.extensions</groupId>
> >> <artifactId>log4j-smtp</artifactId>
> >>
> >> They could inherit the log4j parent and put into the directory as
> >> submodules.
> >>
> >> But I believe it might be beneficial to create a separate repository,
> >> lets say log4j2-extensions and maintain them in some way like Apache
> >> Commons or Apache Onami, as independent artifacts with independent
> >> release cycle.
> >>
> >> If we would do that, we could have a Sandbox and a Proper folder.
> >> Sandbox could be opened to every ASF committer. I imagine there are a
> >> few people who might want to contribute their things. I know a few
> >> people who maintain some log4j1 related stuff, like osgi-log4j in
> >> Apache Sling or I think in Hadoop is something similar (log4j Hadoop
> >> appender)
> >>
> >> Any thoughts?
> >>
> >> Cheers
> >> Christian
> >>
> >> --
> >> http://www.grobmeier.de
> >> https://www.timeandbill.de
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> >> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> >>
> >
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
> > Spring Batch in Action: http://bit.ly/bqpbCK
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
>
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>
--
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
Re: [v2] Where to put appenders with dependency?
Posted by Christian Grobmeier <gr...@gmail.com>.
On Thu, Dec 6, 2012 at 3:21 PM, Gary Gregory <ga...@gmail.com> wrote:
> Hi All:
>
> Please do not make it more complicated than it already is. I profoundly
> dislike having to deal with projects that decide for me that I need to
> reference an API, core, foo and bar jar, and one more jar for this and
> another for that. I don't care, it's a hassle. Just give me an "all" jar
> file (like CXF and Jetty give you the option to use). If I have to dig
> around for yet another Spring jar, I'm going to smash a pumpkin. At
> run-time, if you do not load a class, the deps are not needed. At compile
> time, yes, you need the API deps, but Maven takes care of that for us.
If you make a webapp with the mongo-db appender in it, you have that
lib ready and waiting for you in the libs folder. Even if you don't
need it. That not the problem. But what if i want to use a different
version of mongodb-connector? Do I end up with 2 mongo-db connectors
in the lib folders? Which one is taken?
This case is often happening in log4j1 world, where people need to
write exclude statements for jars which are provided by the container.
While I like to keep things easy, I am not so sure we should put each
and every appender and depenencies into the project at compile time.
Maybe there is an option to make dependencies like mongodb-connector
"provided"- then it would not be delivered, the user would need to
take to create this dependency himself, if he wants to use the mongodb
appender.
Cheers
> Gary
>
>
> On Thu, Dec 6, 2012 at 9:09 AM, Christian Grobmeier <gr...@gmail.com>
> wrote:
>>
>> Hi,
>>
>> lets say we would write an SMTPAppender. It would need dependencies to
>> some mail framework. If you write an MongoDB Appender you wuold have
>> dependencies to the Mongo-Connector.
>>
>> Both dependencies should not come with log4j2 because most people
>> would not need them. Now my first idea was to create a new artifact
>> like:
>>
>> <groupId>org.apache.logging.log4j.extensions</groupId>
>> <artifactId>log4j-smtp</artifactId>
>>
>> They could inherit the log4j parent and put into the directory as
>> submodules.
>>
>> But I believe it might be beneficial to create a separate repository,
>> lets say log4j2-extensions and maintain them in some way like Apache
>> Commons or Apache Onami, as independent artifacts with independent
>> release cycle.
>>
>> If we would do that, we could have a Sandbox and a Proper folder.
>> Sandbox could be opened to every ASF committer. I imagine there are a
>> few people who might want to contribute their things. I know a few
>> people who maintain some log4j1 related stuff, like osgi-log4j in
>> Apache Sling or I think in Hadoop is something similar (log4j Hadoop
>> appender)
>>
>> Any thoughts?
>>
>> Cheers
>> Christian
>>
>> --
>> http://www.grobmeier.de
>> https://www.timeandbill.de
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
> Spring Batch in Action: http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
--
http://www.grobmeier.de
https://www.timeandbill.de
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: [v2] Where to put appenders with dependency?
Posted by Gary Gregory <ga...@gmail.com>.
Hi All:
Please do not make it more complicated than it already is. I profoundly
dislike having to deal with projects that decide for me that I need to
reference an API, core, foo and bar jar, and one more jar for this and
another for that. I don't care, it's a hassle. Just give me an "all" jar
file (like CXF and Jetty give you the option to use). If I have to dig
around for yet another Spring jar, I'm going to smash a pumpkin. At
run-time, if you do not load a class, the deps are not needed. At compile
time, yes, you need the API deps, but Maven takes care of that for us.
Gary
On Thu, Dec 6, 2012 at 9:09 AM, Christian Grobmeier <gr...@gmail.com>wrote:
> Hi,
>
> lets say we would write an SMTPAppender. It would need dependencies to
> some mail framework. If you write an MongoDB Appender you wuold have
> dependencies to the Mongo-Connector.
>
> Both dependencies should not come with log4j2 because most people
> would not need them. Now my first idea was to create a new artifact
> like:
>
> <groupId>org.apache.logging.log4j.extensions</groupId>
> <artifactId>log4j-smtp</artifactId>
>
> They could inherit the log4j parent and put into the directory as
> submodules.
>
> But I believe it might be beneficial to create a separate repository,
> lets say log4j2-extensions and maintain them in some way like Apache
> Commons or Apache Onami, as independent artifacts with independent
> release cycle.
>
> If we would do that, we could have a Sandbox and a Proper folder.
> Sandbox could be opened to every ASF committer. I imagine there are a
> few people who might want to contribute their things. I know a few
> people who maintain some log4j1 related stuff, like osgi-log4j in
> Apache Sling or I think in Hadoop is something similar (log4j Hadoop
> appender)
>
> Any thoughts?
>
> Cheers
> Christian
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>
--
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory