Discussion:
[jira] [Created] (LOG4J2-797) log4j-core should be listed as runtime dependency
whaefelinger (JIRA)
2014-08-25 10:31:57 UTC
Permalink
whaefelinger created LOG4J2-797:
-----------------------------------

Summary: log4j-core should be listed as runtime dependency
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Priority: Minor


The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).

While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.

{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)
Matt Sicker (JIRA)
2014-08-26 04:01:59 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14110243#comment-14110243 ]

Matt Sicker commented on LOG4J2-797:
------------------------------------

The problem with recommending it as a runtime dependency is you need it at compile-time, too, if you have any custom plugins. It contains an annotation processor that makes that possible without additional configuration. This could be a rather confusing idea; personally, I'd make the API a provided dependency and Core a runtime dependency (or provided) while integrating Log4j in my container instead. Then again, that's a bit futuristic at this point.
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Priority: Minor
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
whaefelinger (JIRA)
2014-08-26 10:26:58 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14110579#comment-14110579 ]

whaefelinger commented on LOG4J2-797:
-------------------------------------

Thanks for the clarification although, I must admit, I dot fully get the point why custom plugins do need an annotation processor? But .. never mind.

However, the point that log4j-core can be used as runtime dependency in absence of custom plugins could/should be mentioned in the documentation; it is truly a bit confusing :-)
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Priority: Minor
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Matt Sicker (JIRA)
2014-08-26 12:32:57 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14110651#comment-14110651 ]

Matt Sicker commented on LOG4J2-797:
------------------------------------

The annotation processor is for caching the location of all your plugins. Otherwise, we need to do runtime package scanning and other fun reflection that slows down start-up time. See LOG4J2-798 about that.

As to documenting that, however, I agree. It's a good idea to mention that outside the API JAR(s), you don't really need the others at compile time. Do you have any suggested changes to the docs? Like where in the manual to go over this, patches, etc.?
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Priority: Minor
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-09-19 16:56:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14140871#comment-14140871 ]

Remko Popma commented on LOG4J2-797:
------------------------------------

[~merzedes] We are getting ready to roll out a new release. Do you have any suggestions for where in the manual to make which changes? Or, if you are happy with the explanation, shall we close this issue?
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Priority: Minor
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
whaefelinger (JIRA)
2014-09-23 08:52:33 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14144564#comment-14144564 ]

whaefelinger commented on LOG4J2-797:
-------------------------------------

Sorry for the late reply.

My suggestion is to elaborate on dependencies right below the main chapter titled "Maven, Ivy, and Gradle Artifacts". There I would state, that log4j2 got split in a core and api dependency with the basic idea to have a former as runtime dependency. However, due to technical reasons, e.g. fast startup/annotation processing, the core dependency should (and must) be listed as compile time and not as runtime dependency for now and until further notice.

Having suggested this, I'm fine with closing this case.
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Priority: Minor
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-09-24 02:05:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-797:
-------------------------------
Fix Version/s: 2.1
Assignee: Remko Popma

[~merzedes] Thanks for the clarification. How about this text:

{quote}
Log4j is broken up in an API and an implementation, where the API provides the interface that applications should code to. So, strictly speaking the Log4j implementation is only needed at runtime and not at compile time.

In our recommendations below we list the implementation as a compile time dependency to improve the startup time for [custom plugins|http://logging.apache.org/log4j/2.x/manual/plugins.html].

The implementation contains an annotation processor that will scan for custom plugins during compilation and generate a metadata file that allows Log4j to quickly find custom plugins at runtime. This processor is run by the Java compiler, so the implementation is listed as a compile dependency.
{quote}
Too much detail? Perhaps only add this to the Gradle section instead of at the top of the page?
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Assignee: Remko Popma
Priority: Minor
Fix For: 2.1
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
whaefelinger (JIRA)
2014-09-24 07:55:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146029#comment-14146029 ]

whaefelinger commented on LOG4J2-797:
-------------------------------------

{quote}
Too much detail? Perhaps only add this to the Gradle section instead of at the top of the page?
{quote}

This explanation affects just all build tools, not only the Gradle one. As you can see [here|http://maven.apache.org/plugins/maven-dependency-plugin/list-mojo.html], Maven includes also a "runtime" scope. Thus it affects all build engines and should thus be a top node.

My personal taste is "the more information the better". However, the last paragraph is perhaps too much implementation specific. Thus:
{quote}
Log4j2 is broken up in an API and an implementation (core), where the API provides the interface that applications should code to. Strictly speaking Log4j2 core is only needed at runtime and not at compile time.

However, below we list Log4j2 core as compile time dependency to improve the startup time for [custom plugins|http://logging.apache.org/log4j/2.x/manual/plugins.html].
{quote}

Note: I changed Log4j into Log4j2.

That said, why did I open this ticket? Cause a "natural" consequence of splitting into api/core is to have the latter added as runtime (i.e. exchange the core with another log engine supporting the same api). Obviously, this is currently not possible.

So what is technically missing in your explanation are the consequences of listing log4j2 as runtime dependency. Will it (a) not compile, will it (b) result in a slow startup, will it (c) have no effect in the absence of custom plugins?

By reading the explanation above, I conclude that (c) must be the consequence. Not sure whether this is really the case.
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Assignee: Remko Popma
Priority: Minor
Fix For: 2.1
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Matt Sicker (JIRA)
2014-09-24 13:16:33 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146296#comment-14146296 ]

Matt Sicker commented on LOG4J2-797:
------------------------------------

I'm rethinking my stance on this. In my projects, I use runtime scope for all the dependencies except for log4j-api. It would be useful to note that things like log4j-jcl won't include transitive dependencies when you use the runtime scope (at least in Maven?).
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Assignee: Remko Popma
Priority: Minor
Fix For: 2.1
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-09-24 13:17:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma resolved LOG4J2-797.
--------------------------------
Resolution: Fixed

Pushed to master in commit 83953ba.
Please verify and close.

To answer your question: if my understanding is correct, configuring log4j-core as a runtime dependency (and not as a compile-time dependency) will have no adversary effect if you do not have custom plugins.
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Assignee: Remko Popma
Priority: Minor
Fix For: 2.1
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-09-24 13:20:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146300#comment-14146300 ]

Remko Popma commented on LOG4J2-797:
------------------------------------

Matt, looks like our messages crossed. Does the site text need to be modified?
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Assignee: Remko Popma
Priority: Minor
Fix For: 2.1
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Matt Sicker (JIRA)
2014-09-24 13:26:33 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146305#comment-14146305 ]

Matt Sicker commented on LOG4J2-797:
------------------------------------

No, it looks good now.
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Assignee: Remko Popma
Priority: Minor
Fix For: 2.1
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-09-24 13:28:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146308#comment-14146308 ]

Remko Popma commented on LOG4J2-797:
------------------------------------

OK, thanks.
Post by whaefelinger (JIRA)
log4j-core should be listed as runtime dependency
-------------------------------------------------
Key: LOG4J2-797
URL: https://issues.apache.org/jira/browse/LOG4J2-797
Project: Log4j 2
Issue Type: Improvement
Components: Documentation
Affects Versions: 2.0.2
Environment: http://logging.apache.org/log4j/2.x/maven-artifacts.html
Reporter: whaefelinger
Assignee: Remko Popma
Priority: Minor
Fix For: 2.1
The documentation (website: http://logging.apache.org/log4j/2.x/maven-artifacts.html) lists "log4j-core" as compile dependency (Gradle).
While this at not wrong, it does not hit the idea of api/core separation. Thus I suggest to list "log4j-core" as runtime dependency, i.e.
{code}
dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Loading...