Re: (Fixed) Building with Java 9

2017-07-11 Thread Ralph Goers
Thanks for the info and I’m glad the problem is resolved. Out of curiosity, did 
openjdk-9-java-amd64 on Ubuntu have the JDK and other tools like jstack, jmap, 
etc, or was it just the JRE?

Ralph

> On Jul 11, 2017, at 9:32 PM, kenneth mcfarland  
> wrote:
> 
> I would just like to ask if this information would be useful for the public:
> 
> On Ubuntu 16.04.2, the openjdk-9-java-amd64 via the repository does not
> have javac. Using openjdk-9-java-amd64 (as exposed via the
> toolchain-sample-linux.xml file) will result in failure, at least with sudo
> apt-get install on the latest Ubuntu.
> 
> Only after installing and configuring the oracle version of the jdk-9 early
> access will builds of the log4j2-api-java9 build correctly.
> 
> After discovering the --release flag is a new feature to java 9 I able to
> hunt down the problem. I'd like to save others the frustration of my
> experience. Thanks to Matt and Ralph and others who offered their help and
> expertise in helping me track down a fix.
> 
> Kenneth




(Fixed) Building with Java 9

2017-07-11 Thread kenneth mcfarland
I would just like to ask if this information would be useful for the public:

On Ubuntu 16.04.2, the openjdk-9-java-amd64 via the repository does not
have javac. Using openjdk-9-java-amd64 (as exposed via the
toolchain-sample-linux.xml file) will result in failure, at least with sudo
apt-get install on the latest Ubuntu.

Only after installing and configuring the oracle version of the jdk-9 early
access will builds of the log4j2-api-java9 build correctly.

After discovering the --release flag is a new feature to java 9 I able to
hunt down the problem. I'd like to save others the frustration of my
experience. Thanks to Matt and Ralph and others who offered their help and
expertise in helping me track down a fix.

Kenneth


Re: Log4J2-API-Java9 Build Failure

2017-07-11 Thread kenneth mcfarland
Maven reports finding the java jdk for 9 but fails. I presume it not is not
an openjdk issue because I basically copied the toolchain-sample-linux.xml
file to my .m2 folder. I am using maven 3.5.

Thank you guys so much!

[INFO]

[INFO] Building Apache Log4j API Java 9 support 2.9-SNAPSHOT
[INFO]

[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ log4j-api-java9
---
[INFO] Deleting /home/kenobi/git/logging-log4j2/log4j-api-java9/target
[INFO]
[INFO] --- maven-toolchains-plugin:1.1:toolchain (default) @
log4j-api-java9 ---
[INFO] Required toolchain: jdk [ version='9' ]
*[INFO] Found matching toolchain for type jdk:
JDK[/usr/lib/jvm/java-9-openjdk-amd64]*
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process
(process-resource-bundles) @ log4j-api-java9 ---
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @
log4j-api-java9 ---
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @
log4j-api-java9 ---
[INFO] Toolchain in maven-compiler-plugin:
JDK[/usr/lib/jvm/java-9-openjdk-amd64]
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to
/home/kenobi/git/logging-log4j2/log4j-api-java9/target/classes
[INFO] -
[ERROR] COMPILATION ERROR :
[INFO] -


*[ERROR] javac: invalid flag: --releaseUsage: javac  use -help for a list of possible options*

[INFO] 1 error
[INFO] -
[INFO]

[INFO] Reactor Summary:
[INFO]
[INFO] Apache Log4j 2 . SUCCESS [
4.077 s]
[INFO] Apache Log4j API Java 9 support  FAILURE [
3.117 s]
[INFO] Apache Log4j API ... SKIPPED
[INFO] Apache Log4j Core .. SKIPPED
[INFO] Apache Log4j Core Integration Tests  SKIPPED
[INFO] Apache Log4j 1.x Compatibility API . SKIPPED
[INFO] Apache Log4j SLF4J Binding . SKIPPED
[INFO] Apache Log4j to SLF4J Adapter .. SKIPPED
[INFO] Apache Log4j Commons Logging Bridge  SKIPPED
[INFO] Apache Log4j Flume Bridge .. SKIPPED
[INFO] Apache Log4j Web ... SKIPPED
[INFO] Apache Log4j Tag Library ... SKIPPED
[INFO] Apache Log4j JMX GUI ... SKIPPED
[INFO] Apache Log4j Samples ... SKIPPED
[INFO] Apache Log4j Samples: Flume - Common ... SKIPPED
[INFO] Apache Log4j Samples: Flume - Remote ... SKIPPED
[INFO] Apache Log4j Samples: Flume - Embedded . SKIPPED
[INFO] Apache Log4j Samples: Configuration  SKIPPED
[INFO] Apache Log4j Samples: LoggerProperties . SKIPPED
[INFO] Apache Log4j Scala 2.11 wrapper for Log4j API .. SKIPPED
[INFO] Apache Log4j Samples: Scala API  SKIPPED
[INFO] Apache Log4j OSGi .. SKIPPED
[INFO] Apache Log4j BOM ... SKIPPED
[INFO] Apache Log4j NoSQL . SKIPPED
[INFO] Apache Log4J Performance Tests . SKIPPED
[INFO] Apache Log4j Streaming Interface ... SKIPPED
[INFO] Apache Log4j JUL Adapter ... SKIPPED
[INFO] Apache Log4j Liquibase Binding . SKIPPED
[INFO] Apache Log4j Scala 2.10 wrapper for Log4j API .. SKIPPED
[INFO]

[INFO] BUILD FAILURE
[INFO]

[INFO] Total time: 10.938 s
[INFO] Finished at: 2017-07-11T16:17:22-07:00
[INFO] Final Memory: 26M/63M
[INFO]

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile
(default-compile) on project log4j-api-java9: Compilation failure
[ERROR] javac: invalid flag: --release
[ERROR] Usage: javac  
[ERROR] use -help for a list of possible options
[ERROR]
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the
command
[ERROR]   mvn  -rf :log4j-api-java9


On Tue, Jul 11, 2017 at 6:09 AM, 

[jira] [Commented] (LOG4J2-1973) FailoverAppenders fail to start

2017-07-11 Thread Vina Martin (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16082491#comment-16082491
 ] 

Vina Martin commented on LOG4J2-1973:
-

I tried to recreate this in a different way. I created a disk image and filled 
it up to near capacity then pointed my RollingFile appender to write to a log 
file in that disk. 
Upon startup of my program I still get this:
{{2017-07-11 09:23:56,047 main ERROR appender Failover has no parameter that 
matches element Failovers}}
however the RollingFile appender seems to be working and I verified I saw it 
writing to the file.
When the file became full, when my configuration has:
{code}





{code}
Failover seems to work. 
Not sure why the error message. 

> FailoverAppenders fail to start
> ---
>
> Key: LOG4J2-1973
> URL: https://issues.apache.org/jira/browse/LOG4J2-1973
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders
>Affects Versions: 2.8.2
>Reporter: Vina Martin
>Priority: Critical
>
> I created a simple Hello World program with Log4j2 2.8.2 following the 
> documentation.
> {code}
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> public class HelloWorld {
> private static final Logger logger = 
> LogManager.getLogger(HelloWorld.class);
> public static void main(final String... args) {
> logger.error("A test error- hello world!");
> }
> }
> {code}
> with the following configuration in {{log4j2.xml}}
> {code}
> 
> 
> 
> 
> 
> 
>  filePattern="logs/app-%d{MM-dd-}.log.gz"
>  ignoreExceptions="false">
> 
> %d %p %c{1.} [%t] %m%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> I get this error when starting up my program: {{ERROR appender Failover has 
> no parameter that matches element Failovers}}. I observed that the hello 
> world message appeared in the log file and was properly appended each time I 
> ran my hello world program. 
> Then, I tried to simulate a scenario where a failover would happen to verify 
> that the failover appender is not starting properly. I locked the log file to 
> be read-only. After locking the file I ran the program and saw the following 
> output:
> {code}
> 2017-07-10 08:52:25,802 main ERROR RollingFileManager (logs/app.log) 
> java.io.FileNotFoundException: logs/app.log (Permission denied) 
> java.io.FileNotFoundException: logs/app.log (Permission denied)
>   at java.io.FileOutputStream.open0(Native Method)
>   at java.io.FileOutputStream.open(FileOutputStream.java:270)
>   at java.io.FileOutputStream.(FileOutputStream.java:213)
>   at java.io.FileOutputStream.(FileOutputStream.java:133)
>   at 
> org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:587)
>   at 
> org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:554)
>   at 
> org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:112)
>   at 
> org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
>   at 
> org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:155)
>   at 
> org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:131)
>   at 
> org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:60)
>   at 
> org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
>   at 
> org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:952)
>   at 
> org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:892)
>   at 
> org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:884)
>   at 
> org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:508)
>   at 
> org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:232)
>   at 
> org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:244)
>   at 
> org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
>   at 
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:617)
>   at 
> 

[jira] [Commented] (LOG4J2-1864) Support capped collection for MongoDB Log-Provider

2017-07-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16082270#comment-16082270
 ] 

ASF GitHub Bot commented on LOG4J2-1864:


Github user jvz commented on the issue:

https://github.com/apache/logging-log4j2/pull/62
  

https://github.com/apache/logging-log4j2/blob/master/src/site/xdoc/manual/appenders.xml
 is the appenders manual page which should be what you're looking for. Just 
follow the patterns for how to markup the docs.


> Support capped collection for MongoDB Log-Provider
> --
>
> Key: LOG4J2-1864
> URL: https://issues.apache.org/jira/browse/LOG4J2-1864
> Project: Log4j 2
>  Issue Type: New Feature
>  Components: Appenders
>Reporter: Matt
>
> MongoDB supports sth. called capped collections. If the 
> nosql-mongodb-appender supports this feature, the mongodb-collection could 
> never "overflow" and stick to a defined maximum size.
> see [pull request 62|https://github.com/apache/logging-log4j2/pull/62] for 
> more details.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] logging-log4j2 issue #62: (LOG4J2-1864) Support capped collection for MongoD...

2017-07-11 Thread jvz
Github user jvz commented on the issue:

https://github.com/apache/logging-log4j2/pull/62
  

https://github.com/apache/logging-log4j2/blob/master/src/site/xdoc/manual/appenders.xml
 is the appenders manual page which should be what you're looking for. Just 
follow the patterns for how to markup the docs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Log4J2-API-Java9 Build Failure

2017-07-11 Thread Apache
Somehow your tool chain is not being found. The --release option is only 
available in java 9. When the build runs the compile plugin should tell you 
that it is using the Java 9 tool chain.

Ralph

> On Jul 10, 2017, at 9:51 PM, kenneth mcfarland  
> wrote:
> 
> I am running Ubuntu 16.04.2 LTS AMD 64
> 
> The sole purpose of my laptop is to get this build to work. I've literally
> reformatted my machine just for this project and I'm at my wits end trying
> to figure this out after googling for 2 days.
> 
> I've made sure the POM reflects the correct path to my jdk, and I've
> experimented the oracle early release jdk, openjdk 9. I made the
> toolchains.xml file point t the correct java 9 paths.
> 
> If it doesn't complain about not finding JDK=9, then it fails on this:
> 
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile
> (default-compile) on project log4j-api-java9: Compilation failure
> [ERROR] javac: invalid flag: --release
> [ERROR] Usage: javac  
> [ERROR] use -help for a list of possible options
> 
> Other modules in the trunk build fine, but I want them all to build the way
> they should. Any advice would be greatly apprecaited!
> 
> Kenneth




[jira] [Commented] (LOG4J2-1852) Plugins lookup by package is not compatible with Spring Boot jar packaging

2017-07-11 Thread Tanner Altares (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16082052#comment-16082052
 ] 

Tanner Altares commented on LOG4J2-1852:


Is there any update or on this issue?  As stated by the Spring Boot team using 
the JARURLConnection route could eliminate the need to modify the URL done by 
the ResolverUtil.  A possible approach with limited modifications could be to 
overload the loadImplementationsInJar method to allow for a JarFile and do the 
needed matching tests.  This should handle common packaging structures of 
jars/wars along with the nested approach for Spring Boot's packaging.


{code:java}
private void loadImplementationsInJar(ResolverUtil.Test test, String parent, 
JarFile jarFile) {

final Enumeration entries = jarFile.entries();

while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
String name = entry.getName();

if (!entry.isDirectory() && name.startsWith(parent) && 
this.isTestApplicable(test, name)) {
this.addIfMatching(test, name);
}
}
 }
{code}


> Plugins lookup by package is not compatible with Spring Boot jar packaging
> --
>
> Key: LOG4J2-1852
> URL: https://issues.apache.org/jira/browse/LOG4J2-1852
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Plugins
>Affects Versions: 2.7
> Environment: Spring Boot 1.5.x, java 8
>Reporter: Maksym Novoseltsev
>Priority: Minor
>
> Here is you can find a description of the issue and pretty usefull answer 
> from Spring Boot team regarding the very same issue:
> https://github.com/spring-projects/spring-boot/issues/8637
> Also you will find a sample project there that will help to reproduce issue.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] logging-log4j2 pull request #92: consider the StringBuilder's capacity inste...

2017-07-11 Thread xnslong
GitHub user xnslong opened a pull request:

https://github.com/apache/logging-log4j2/pull/92

consider the StringBuilder's capacity instead of content length when do the 
trim

The trim operation aims at releasing the too much memory occupied by the 
`StringBuilder`. So when the StringBuilder really contains few effective 
characters, but with large capacity, should also be trimmed.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xnslong/logging-log4j2 master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/logging-log4j2/pull/92.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #92


commit d61379bc66b977f53f51e0c5caeee7193aca1f32
Author: Jerry 
Date:   2017-07-11T09:15:36Z

Merge pull request #1 from apache/master

pull latest changes from base

commit ab07e40e178e62e07234d45a056770370be7e1cc
Author: xnslong 
Date:   2017-07-11T09:40:21Z

StringBuilders determine if trim is necessary on StringBuilders capacity 
instead of content length

commit 9db3f5115e2eb047562fcf4c1e34fa1d7c8e4e86
Author: xnslong 
Date:   2017-07-11T09:56:38Z

update test case




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (LOG4J2-1972) The "packages" attribute in appender configuration reporting ERROR

2017-07-11 Thread Seweryn Habdank-Wojewodzki (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16081941#comment-16081941
 ] 

Seweryn Habdank-Wojewodzki commented on LOG4J2-1972:


[~ralph.go...@dslextreme.com] Thanks a lot for very fast responce.

> The "packages" attribute in appender configuration reporting ERROR
> --
>
> Key: LOG4J2-1972
> URL: https://issues.apache.org/jira/browse/LOG4J2-1972
> Project: Log4j 2
>  Issue Type: Question
> Environment: Linux Red Hat.
>Reporter: Seweryn Habdank-Wojewodzki
>Priority: Minor
>
> We are using Log4j2 v. 2.8. 
> We have own appender configuration more less:
> {code:xml}
>  packages="my.company.myappender.log4j2">
> ...
>   my-app
> 
> {code}
> In the documentation [Property 
> Substitution|https://logging.apache.org/log4j/2.x/manual/configuration.html#Property%20Substitution]
>  we can read:
> packages  A comma separated list of package names to search for plugins. 
> Plugins are only loaded once per classloader so changing this value may not 
> have any effect upon reconfiguration.
> But anyhow we got error:
> {{2017-07-10 16:37:03,017 localhost-startStop-3 ERROR MyAppender contains an 
> invalid element or attribute "packages"}}
> How shall we handle this attribute?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (LOG4J2-1864) Support capped collection for MongoDB Log-Provider

2017-07-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16081857#comment-16081857
 ] 

ASF GitHub Bot commented on LOG4J2-1864:


Github user codescale commented on the issue:

https://github.com/apache/logging-log4j2/pull/62
  
I must admit I don't know where/how I can help you to keep the docs up to 
date. If I'm able to help, please point me to the right location :) thanks.


> Support capped collection for MongoDB Log-Provider
> --
>
> Key: LOG4J2-1864
> URL: https://issues.apache.org/jira/browse/LOG4J2-1864
> Project: Log4j 2
>  Issue Type: New Feature
>  Components: Appenders
>Reporter: Matt
>
> MongoDB supports sth. called capped collections. If the 
> nosql-mongodb-appender supports this feature, the mongodb-collection could 
> never "overflow" and stick to a defined maximum size.
> see [pull request 62|https://github.com/apache/logging-log4j2/pull/62] for 
> more details.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] logging-log4j2 issue #62: (LOG4J2-1864) Support capped collection for MongoD...

2017-07-11 Thread codescale
Github user codescale commented on the issue:

https://github.com/apache/logging-log4j2/pull/62
  
I must admit I don't know where/how I can help you to keep the docs up to 
date. If I'm able to help, please point me to the right location :) thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] logging-log4j2 issue #82: Add a new LuceneAppender which writes logging even...

2017-07-11 Thread liyuj
Github user liyuj commented on the issue:

https://github.com/apache/logging-log4j2/pull/82
  
This PR does not have a corresponding issue.
The code is used within our company and we think he has reusability, so it 
contributes to the community.
The functionality has been tested and no problem.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---