[jira] [Commented] (LOG4J2-2211) MainMapLookup ${main:--file} placeholder doesn't work

2018-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LOG4J2-2211:


Github user wangzhongkuo commented on the issue:

https://github.com/apache/logging-log4j2/pull/145
  
I'm puzzled why the all checks failed...
`
$ ./mvnw --toolchains=./.travis-toolchains.xml install -DskipTests=true 
-Dmaven.javadoc.skip=true -B -V
Error: JAVA_HOME is not defined correctly.
  We cannot execute /usr/lib/jvm/java-7-oracle/bin/java
The command "./mvnw --toolchains=./.travis-toolchains.xml install 
-DskipTests=true -Dmaven.javadoc.skip=true -B -V" failed and exited with 1 
during .
Your build has been stopped.
`
zhongkuo


> MainMapLookup ${main:--file} placeholder doesn't work
> -
>
> Key: LOG4J2-2211
> URL: https://issues.apache.org/jira/browse/LOG4J2-2211
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Lookups
>Affects Versions: 2.10.0
> Environment: java: 1.7
> log4j: 2.10.0
> os : windows
>Reporter: wangzhongkuo
>Priority: Blocker
>  Labels: newbie
>
> I use the MainMapLookup like the 
> documentation([http://logging.apache.org/log4j/2.x/manual/lookups.html#AppMainArgsLookup),b|http://logging.apache.org/log4j/2.x/manual/lookups.html#AppMainArgsLookup),i]ut
>  the "${main:–file}" doesn't work, it replace the placeholder by default 
> value "-file".
> log4j2.xml(log4j2 2.10.0)
>  
> {code:java}
> 
> 
> 
> 
>  pattern="%d [%t] [${main:--file}] %-5level: %msg%n%throwable" />
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> im sure i have written the code: MainMapLookup.setMainArguments(args);
>  
> my program arguments are : --file foo.txt --verbose -x bar
> so i traced the source code, in StrSubstitutor.class line 958, it changes my 
> varName "main:–file" to "main". i can't understand the code : "varName = 
> varNameExpr.substring(0, i);"
> {code:java}
> if (valueDelimiterMatcher != null) {
> final char [] varNameExprChars = varNameExpr.toCharArray();
> int valueDelimiterMatchLen = 0;
> for (int i = 0; i < varNameExprChars.length; i++) {
> // if there's any nested variable when nested variable substitution disabled, 
> then stop resolving name and default value.
> if (!substitutionInVariablesEnabled
> && prefixMatcher.isMatch(varNameExprChars, i, i, varNameExprChars.length) != 
> 0) {
> break;
> }
> if ((valueDelimiterMatchLen = valueDelimiterMatcher.isMatch(varNameExprChars, 
> i)) != 0) {
> varName = varNameExpr.substring(0, i);
> varDefaultValue = varNameExpr.substring(i + valueDelimiterMatchLen);
> break;
> }
> }
> }
> {code}
> then org.apache.logging.log4j.core.lookup.Interpolator.class
>  
> {code:java}
> @Override
> public String lookup(final LogEvent event, String var) {
> if (var == null) {
> return null;
> }
> final int prefixPos = var.indexOf(PREFIX_SEPARATOR);
> if (prefixPos >= 0) {
> final String prefix = var.substring(0, prefixPos).toLowerCase(Locale.US);
> final String name = var.substring(prefixPos + 1);
> final StrLookup lookup = lookups.get(prefix);
> if (lookup instanceof ConfigurationAware) {
> ((ConfigurationAware) lookup).setConfiguration(configuration);
> }
> String value = null;
> if (lookup != null) {
> value = event == null ? lookup.lookup(name) : lookup.lookup(event, name);
> }
> if (value != null) {
> return value;
> }
> var = var.substring(prefixPos + 1);
> }
> if (defaultLookup != null) {
> return event == null ? defaultLookup.lookup(var) : 
> defaultLookup.lookup(event, var);
> }
> return null;
> }
> {code}
> in the red mark, var="main" and prefixPos=-1. so it return the default value 
> "-file";
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] logging-log4j2 issue #145: fix bug LOG4J2-2211

2018-01-25 Thread wangzhongkuo
Github user wangzhongkuo commented on the issue:

https://github.com/apache/logging-log4j2/pull/145
  
I'm puzzled why the all checks failed...
`
$ ./mvnw --toolchains=./.travis-toolchains.xml install -DskipTests=true 
-Dmaven.javadoc.skip=true -B -V
Error: JAVA_HOME is not defined correctly.
  We cannot execute /usr/lib/jvm/java-7-oracle/bin/java
The command "./mvnw --toolchains=./.travis-toolchains.xml install 
-DskipTests=true -Dmaven.javadoc.skip=true -B -V" failed and exited with 1 
during .
Your build has been stopped.
`
zhongkuo


---


[jira] [Commented] (LOG4J2-2211) MainMapLookup ${main:--file} placeholder doesn't work

2018-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LOG4J2-2211:


Github user wangzhongkuo commented on the issue:

https://github.com/apache/logging-log4j2/pull/144
  
I have committed a new PR to the repository(pull 145) and i have run the 
first three steps, please check it.


> MainMapLookup ${main:--file} placeholder doesn't work
> -
>
> Key: LOG4J2-2211
> URL: https://issues.apache.org/jira/browse/LOG4J2-2211
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Lookups
>Affects Versions: 2.10.0
> Environment: java: 1.7
> log4j: 2.10.0
> os : windows
>Reporter: wangzhongkuo
>Priority: Blocker
>  Labels: newbie
>
> I use the MainMapLookup like the 
> documentation([http://logging.apache.org/log4j/2.x/manual/lookups.html#AppMainArgsLookup),b|http://logging.apache.org/log4j/2.x/manual/lookups.html#AppMainArgsLookup),i]ut
>  the "${main:–file}" doesn't work, it replace the placeholder by default 
> value "-file".
> log4j2.xml(log4j2 2.10.0)
>  
> {code:java}
> 
> 
> 
> 
>  pattern="%d [%t] [${main:--file}] %-5level: %msg%n%throwable" />
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> im sure i have written the code: MainMapLookup.setMainArguments(args);
>  
> my program arguments are : --file foo.txt --verbose -x bar
> so i traced the source code, in StrSubstitutor.class line 958, it changes my 
> varName "main:–file" to "main". i can't understand the code : "varName = 
> varNameExpr.substring(0, i);"
> {code:java}
> if (valueDelimiterMatcher != null) {
> final char [] varNameExprChars = varNameExpr.toCharArray();
> int valueDelimiterMatchLen = 0;
> for (int i = 0; i < varNameExprChars.length; i++) {
> // if there's any nested variable when nested variable substitution disabled, 
> then stop resolving name and default value.
> if (!substitutionInVariablesEnabled
> && prefixMatcher.isMatch(varNameExprChars, i, i, varNameExprChars.length) != 
> 0) {
> break;
> }
> if ((valueDelimiterMatchLen = valueDelimiterMatcher.isMatch(varNameExprChars, 
> i)) != 0) {
> varName = varNameExpr.substring(0, i);
> varDefaultValue = varNameExpr.substring(i + valueDelimiterMatchLen);
> break;
> }
> }
> }
> {code}
> then org.apache.logging.log4j.core.lookup.Interpolator.class
>  
> {code:java}
> @Override
> public String lookup(final LogEvent event, String var) {
> if (var == null) {
> return null;
> }
> final int prefixPos = var.indexOf(PREFIX_SEPARATOR);
> if (prefixPos >= 0) {
> final String prefix = var.substring(0, prefixPos).toLowerCase(Locale.US);
> final String name = var.substring(prefixPos + 1);
> final StrLookup lookup = lookups.get(prefix);
> if (lookup instanceof ConfigurationAware) {
> ((ConfigurationAware) lookup).setConfiguration(configuration);
> }
> String value = null;
> if (lookup != null) {
> value = event == null ? lookup.lookup(name) : lookup.lookup(event, name);
> }
> if (value != null) {
> return value;
> }
> var = var.substring(prefixPos + 1);
> }
> if (defaultLookup != null) {
> return event == null ? defaultLookup.lookup(var) : 
> defaultLookup.lookup(event, var);
> }
> return null;
> }
> {code}
> in the red mark, var="main" and prefixPos=-1. so it return the default value 
> "-file";
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] logging-log4j2 issue #144: [LOG4J2-2211] Update StrSubstitutor.java

2018-01-25 Thread wangzhongkuo
Github user wangzhongkuo commented on the issue:

https://github.com/apache/logging-log4j2/pull/144
  
I have committed a new PR to the repository(pull 145) and i have run the 
first three steps, please check it.


---


[jira] [Commented] (LOG4J2-2211) MainMapLookup ${main:--file} placeholder doesn't work

2018-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LOG4J2-2211:


GitHub user wangzhongkuo opened a pull request:

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

fix bug LOG4J2-2211 

I have written an unit test

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

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

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

https://github.com/apache/logging-log4j2/pull/145.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 #145


commit 35d2bc2ac11296e23efc7a78f362d87354b19235
Author: wangzhongkuo 
Date:   2018-01-26T07:33:14Z

fix bug LOG4J2-2211 
(https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2211?filter=addedrecently)




> MainMapLookup ${main:--file} placeholder doesn't work
> -
>
> Key: LOG4J2-2211
> URL: https://issues.apache.org/jira/browse/LOG4J2-2211
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Lookups
>Affects Versions: 2.10.0
> Environment: java: 1.7
> log4j: 2.10.0
> os : windows
>Reporter: wangzhongkuo
>Priority: Blocker
>  Labels: newbie
>
> I use the MainMapLookup like the 
> documentation([http://logging.apache.org/log4j/2.x/manual/lookups.html#AppMainArgsLookup),b|http://logging.apache.org/log4j/2.x/manual/lookups.html#AppMainArgsLookup),i]ut
>  the "${main:–file}" doesn't work, it replace the placeholder by default 
> value "-file".
> log4j2.xml(log4j2 2.10.0)
>  
> {code:java}
> 
> 
> 
> 
>  pattern="%d [%t] [${main:--file}] %-5level: %msg%n%throwable" />
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> im sure i have written the code: MainMapLookup.setMainArguments(args);
>  
> my program arguments are : --file foo.txt --verbose -x bar
> so i traced the source code, in StrSubstitutor.class line 958, it changes my 
> varName "main:–file" to "main". i can't understand the code : "varName = 
> varNameExpr.substring(0, i);"
> {code:java}
> if (valueDelimiterMatcher != null) {
> final char [] varNameExprChars = varNameExpr.toCharArray();
> int valueDelimiterMatchLen = 0;
> for (int i = 0; i < varNameExprChars.length; i++) {
> // if there's any nested variable when nested variable substitution disabled, 
> then stop resolving name and default value.
> if (!substitutionInVariablesEnabled
> && prefixMatcher.isMatch(varNameExprChars, i, i, varNameExprChars.length) != 
> 0) {
> break;
> }
> if ((valueDelimiterMatchLen = valueDelimiterMatcher.isMatch(varNameExprChars, 
> i)) != 0) {
> varName = varNameExpr.substring(0, i);
> varDefaultValue = varNameExpr.substring(i + valueDelimiterMatchLen);
> break;
> }
> }
> }
> {code}
> then org.apache.logging.log4j.core.lookup.Interpolator.class
>  
> {code:java}
> @Override
> public String lookup(final LogEvent event, String var) {
> if (var == null) {
> return null;
> }
> final int prefixPos = var.indexOf(PREFIX_SEPARATOR);
> if (prefixPos >= 0) {
> final String prefix = var.substring(0, prefixPos).toLowerCase(Locale.US);
> final String name = var.substring(prefixPos + 1);
> final StrLookup lookup = lookups.get(prefix);
> if (lookup instanceof ConfigurationAware) {
> ((ConfigurationAware) lookup).setConfiguration(configuration);
> }
> String value = null;
> if (lookup != null) {
> value = event == null ? lookup.lookup(name) : lookup.lookup(event, name);
> }
> if (value != null) {
> return value;
> }
> var = var.substring(prefixPos + 1);
> }
> if (defaultLookup != null) {
> return event == null ? defaultLookup.lookup(var) : 
> defaultLookup.lookup(event, var);
> }
> return null;
> }
> {code}
> in the red mark, var="main" and prefixPos=-1. so it return the default value 
> "-file";
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] logging-log4j2 pull request #145: fix bug LOG4J2-2211

2018-01-25 Thread wangzhongkuo
GitHub user wangzhongkuo opened a pull request:

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

fix bug LOG4J2-2211 

I have written an unit test

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

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

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

https://github.com/apache/logging-log4j2/pull/145.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 #145


commit 35d2bc2ac11296e23efc7a78f362d87354b19235
Author: wangzhongkuo 
Date:   2018-01-26T07:33:14Z

fix bug LOG4J2-2211 
(https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2211?filter=addedrecently)




---


[jira] [Created] (LOG4J2-2222) log4j2 has GUI tool to export xml or yml configuration file

2018-01-25 Thread wyyang (JIRA)
wyyang created LOG4J2-:
--

 Summary:  log4j2 has GUI tool to export xml or yml configuration 
file
 Key: LOG4J2-
 URL: https://issues.apache.org/jira/browse/LOG4J2-
 Project: Log4j 2
  Issue Type: Improvement
  Components: log4j 1.2 emulation
Reporter: wyyang


hi all, 

log4j2 has lots of attributes,  do we have the GUI tool to edit it and export 
xml file etc ? .

For netconf yang ,we have serval GUI tools to export yang file , so i think we 
also have this tool . :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2220) Log4j2 Causing Fatal Exception in Android Project

2018-01-25 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-2220:
-

Any patches and pull requests (ideally with unit test) are always appreciated 
but especially in the Android area, because the community doesn’t usually work 
on Android or can test on that platform. 

> Log4j2 Causing Fatal Exception in Android Project
> -
>
> Key: LOG4J2-2220
> URL: https://issues.apache.org/jira/browse/LOG4J2-2220
> Project: Log4j 2
>  Issue Type: Bug
>Affects Versions: 2.3, 2.4, 2.5, 2.6, 2.7, 2.8
> Environment: OS X El Capitan
> IntelliJ IDEA 2017.3.3
> Android SDK 26
> JDK 8
> Gradle 2.3
>Reporter: Mark Hoffner
>Priority: Major
>
> Moving a Java project with Maven over to an Android project with Gradle in 
> IntelliJ and everything made the transition smoothly except for Log4j2.
> This error message fires whenever the program tries to create a Logger:
> {{java.lang.ExceptionInInitializerError at java.lang.Class.newInstance(Native 
> Method) at android.app.Instrumentation.newActivity(Instrumentation.java:1078) 
> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2538) 
> at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
> at android.app.ActivityThread.-wrap12(ActivityThread.java) at 
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) at 
> android.os.Handler.dispatchMessage(Handler.java:102) at 
> android.os.Looper.loop(Looper.java:154) at 
> android.app.ActivityThread.main(ActivityThread.java:6077) at 
> java.lang.reflect.Method.invoke(Native Method) at 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
>  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) Caused by: 
> java.lang.NullPointerException: Attempt to get length of null array at 
> org.apache.logging.log4j.util.ReflectionUtil$PrivateSecurityManager.getCallerClass(ReflectionUtil.java:301)
>  at 
> org.apache.logging.log4j.util.ReflectionUtil.getCallerClass(ReflectionUtil.java:214)
>  at 
> org.apache.logging.log4j.util.ReflectionUtil.getCallerClass(ReflectionUtil.java:193)
>  at 
> org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:72)
>  at 
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:195)
>  at 
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
>  at org.apache.logging.log4j.LogManager.getContext(LogManager.java:160) at 
> org.apache.logging.log4j.LogManager.getLogger(LogManager.java:492) at 
> com.company.sample.MainActivity.(MainActivity.java:18) at 
> java.lang.Class.newInstance(Native Method)  at 
> android.app.Instrumentation.newActivity(Instrumentation.java:1078)  at 
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2538)  
> at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)  
> at android.app.ActivityThread.-wrap12(ActivityThread.java)  at 
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)  at 
> android.os.Handler.dispatchMessage(Handler.java:102)  at 
> android.os.Looper.loop(Looper.java:154)  at 
> android.app.ActivityThread.main(ActivityThread.java:6077)  at 
> java.lang.reflect.Method.invoke(Native Method)  at 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
>   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) }}
> Here's the build.gradle:
> {{apply plugin: 'com.android.application' sourceCompatibility = 1.8 
> targetCompatibility = 1.8 android { compileSdkVersion 26 buildToolsVersion 
> "27.0.3" defaultConfig { applicationId "com.company.sample" minSdkVersion 15 
> targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner 
> "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true } 
> buildTypes { release { minifyEnabled false proguardFiles 
> getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 
> packagingOptions { pickFirst 'META-INF/DEPENDENCIES' pickFirst 
> 'META-INF/LICENSE' pickFirst 
> 'META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat' } 
> dexOptions { javaMaxHeapSize "4g" } } repositories { flatDir { dirs 'libs' } 
> } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) 
> androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
> exclude group: 'com.android.support', module: 'support-annotations' }) 
> compile 'com.android.support:appcompat-v7:26.+' compile 
> 'com.android.support.constraint:constraint-layout:1.0.2' compile group: 
> 'org.apache.logging.log4j', name: 'log4j-api', version:'2.3' compile group: 
> 'org.apache.lo

[jira] [Assigned] (LOG4J2-2188) Split off JPA support into a new module log4j-jpa

2018-01-25 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-2188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory reassigned LOG4J2-2188:


Assignee: Gary Gregory

> Split off JPA support into a new module log4j-jpa
> -
>
> Key: LOG4J2-2188
> URL: https://issues.apache.org/jira/browse/LOG4J2-2188
> Project: Log4j 2
>  Issue Type: New Feature
>Reporter: Gary Gregory
>Assignee: Gary Gregory
>Priority: Major
>
> Split off JPA support into a new module log4j-jpa.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (LOG4J2-2195) Cannot define both `filters` and `separator` for PatternLayout %xEx

2018-01-25 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory resolved LOG4J2-2195.
--
   Resolution: Fixed
Fix Version/s: 2.11.0

I have a fix in git master. Please try a {{2.10.1-SNAPSHOT}} build from our 
snapshot repository 
https://repository.apache.org/content/repositories/snapshots/. Also note that 
the syntax for the pattern must be:
{noformat}

{noformat}

If that works for you, please close this ticket.

> Cannot define both `filters` and `separator` for PatternLayout %xEx
> ---
>
> Key: LOG4J2-2195
> URL: https://issues.apache.org/jira/browse/LOG4J2-2195
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Pattern Converters
>Affects Versions: 2.10.0
>Reporter: Raman Gupta
>Assignee: Gary Gregory
>Priority: Minor
> Fix For: 2.11.0
>
>
> Defining a pattern layout that contains:
> {{%xEx\{full,filters(${exceptionFilters}),separator(|)}}}
> does not work – the filters are applied but the separator is not.
> Only if the filters are removed does the separator apply to the layout.
> Reproduction recipe, including config file and test program here: 
> https://gist.github.com/rocketraman/9a92ce76ee79bf6a15ab9b3a5ec95e08
> Above you can see that the exception separator was not applied -- the default 
> newlines are present in the output instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (LOG4J2-2221) RootThrowablePatternConverter does not use TextRenderer or line separator options

2018-01-25 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory closed LOG4J2-2221.

Resolution: Fixed

Closing: In git master.

> RootThrowablePatternConverter does not use TextRenderer or line separator 
> options
> -
>
> Key: LOG4J2-2221
> URL: https://issues.apache.org/jira/browse/LOG4J2-2221
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Layouts
>Reporter: Gary Gregory
>Assignee: Gary Gregory
>Priority: Major
> Fix For: 2.11.0
>
>
> The {{RootThrowablePatternConverter}} does not use the {{TextRenderer}} or 
> line {{separator}} options.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2221) RootThrowablePatternConverter does not use TextRenderer or line separator options

2018-01-25 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on LOG4J2-2221:
-

Commit ee2d6dcf28fe07f88ad930e039d7255db50bf2b8 in logging-log4j2's branch 
refs/heads/master from [~garydgregory]
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=ee2d6dc ]

[LOG4J2-2221] RootThrowablePatternConverter does not use TextRenderer or
line separator options.

> RootThrowablePatternConverter does not use TextRenderer or line separator 
> options
> -
>
> Key: LOG4J2-2221
> URL: https://issues.apache.org/jira/browse/LOG4J2-2221
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Layouts
>Reporter: Gary Gregory
>Assignee: Gary Gregory
>Priority: Major
> Fix For: 2.11.0
>
>
> The {{RootThrowablePatternConverter}} does not use the {{TextRenderer}} or 
> line {{separator}} options.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2195) Cannot define both `filters` and `separator` for PatternLayout %xEx

2018-01-25 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on LOG4J2-2195:
-

Commit 9ff63b2e50be754ae394feda2c33d9e64fd0ab3a in logging-log4j2's branch 
refs/heads/master from [~garydgregory]
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=9ff63b2 ]

[LOG4J2-2195] Cannot define both `filters` and `separator` for
PatternLayout %xEx.

> Cannot define both `filters` and `separator` for PatternLayout %xEx
> ---
>
> Key: LOG4J2-2195
> URL: https://issues.apache.org/jira/browse/LOG4J2-2195
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Pattern Converters
>Affects Versions: 2.10.0
>Reporter: Raman Gupta
>Assignee: Gary Gregory
>Priority: Minor
>
> Defining a pattern layout that contains:
> {{%xEx\{full,filters(${exceptionFilters}),separator(|)}}}
> does not work – the filters are applied but the separator is not.
> Only if the filters are removed does the separator apply to the layout.
> Reproduction recipe, including config file and test program here: 
> https://gist.github.com/rocketraman/9a92ce76ee79bf6a15ab9b3a5ec95e08
> Above you can see that the exception separator was not applied -- the default 
> newlines are present in the output instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2205) New module log4j-mongodb3: Remove use of deprecated MongoDB APIs and code to the Java driver version 3 API

2018-01-25 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on LOG4J2-2205:
-

Commit 532024a43b99c41de02c85f76ceb4c591820b73e in logging-log4j2's branch 
refs/heads/master from ggregory
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=532024a ]

[LOG4J2-2205] New module log4j-mongodb3: Remove use of deprecated
MongoDB APIs and code to the Java driver version 3 API. Fix Copy-Paste
error in due-to attribute.

> New module log4j-mongodb3: Remove use of deprecated MongoDB APIs and code to 
> the Java driver version 3 API
> --
>
> Key: LOG4J2-2205
> URL: https://issues.apache.org/jira/browse/LOG4J2-2205
> Project: Log4j 2
>  Issue Type: Improvement
>  Components: Appenders, MongoDB
>Reporter: Gary Gregory
>Priority: Major
> Fix For: 2.11.0
>
>
> Add new module {{log4j-mongodb3}}.
> Remove use of deprecated MongoDB APIs and code to the Java driver version 3 
> API
> Deprecated call sites:
> {noformat}
> Description   ResourcePathLocationType
> The constructor MongoClient(ServerAddress, List) is 
> deprecated   MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 299  
>   Java Problem
> The method getDB(String) from the type Mongo is deprecated
> MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 250  
>   Java Problem
> The method getDB(String) from the type Mongo is deprecated
> MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 299  
>   Java Problem
> {noformat}
> As of commit {{b993a2138992f84ff834aa10a2e6b7640f3aa8d7}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (LOG4J2-1838) Add support for appending common suffix to each line of throwable stack trace

2018-01-25 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-1838?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory closed LOG4J2-1838.


Closing: Released in 2.8.2.

> Add support for appending common suffix to each line of throwable stack trace
> -
>
> Key: LOG4J2-1838
> URL: https://issues.apache.org/jira/browse/LOG4J2-1838
> Project: Log4j 2
>  Issue Type: New Feature
>  Components: Pattern Converters
>Affects Versions: 2.8.1
>Reporter: Zilong Song
>Assignee: Matt Sicker
>Priority: Major
>  Labels: features
> Fix For: 2.8.2
>
>
> Add support for appending common suffix to each line of throwable stack 
> trace. The suffix can be configured by patterns just like patterns used 
> elsewhere. 
> For example, pattern {{%xEx{suffix(- %mdc{key})}}} will 
> append a string generated by pattern {{- }}  and {{%mdc{key}}}.
> But patterns that handles throwable will be automatically ignored, because 
> they will make the rendered result confusing. So pattern {{%xEx{suffix(- 
> %rEx%mdc{key})}}} has the same effect with 
> {{%xEx{suffix(- %mdc{key})}}}, as if the nested {{%rEx}} 
> pattern has never appeared.
> Following is an example of the with such suffix: 
> {code:title=stack trace, with pattern "%xEx{suffix(- 
> %mdc{key})}" and MDC(key)="test mdc suffix"|borderStyle=solid}
> java.lang.IllegalArgumentException: IllegalArgument - test mdc suffix
>   at 
> org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverterTest.testSuffixFromNormalPattern(ExtendedThrowablePatternConverterTest.java:48)
>  [test-classes/:?] - test mdc suffix
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
> ~[?:1.8.0_91] - test mdc suffix
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[?:1.8.0_91] - test mdc suffix
>   at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] - 
> test mdc suffix
>   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) 
> [idea_rt.jar:?] - test mdc suffix
> Caused by: java.lang.NullPointerException: null pointer - test mdc suffix
>   at 
> org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverterTest.testSuffixFromNormalPattern(ExtendedThrowablePatternConverterTest.java:47)
>  ~[test-classes/:?] - test mdc suffix
>   ... 27 more - test mdc suffix
> }}
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (LOG4J2-2221) RootThrowablePatternConverter does not use TextRenderer or line separator options

2018-01-25 Thread Gary Gregory (JIRA)
Gary Gregory created LOG4J2-2221:


 Summary: RootThrowablePatternConverter does not use TextRenderer 
or line separator options
 Key: LOG4J2-2221
 URL: https://issues.apache.org/jira/browse/LOG4J2-2221
 Project: Log4j 2
  Issue Type: Bug
  Components: Layouts
Reporter: Gary Gregory
Assignee: Gary Gregory
 Fix For: 2.11.0


The {{RootThrowablePatternConverter}} does not use the {{TextRenderer}} or line 
{{separator}} options.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2211) MainMapLookup ${main:--file} placeholder doesn't work

2018-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LOG4J2-2211:


Github user garydgregory commented on the issue:

https://github.com/apache/logging-log4j2/pull/144
  
Hello,
The fastest way to get traction on this issue is to provide a unit test in 
this PR.
Gary


> MainMapLookup ${main:--file} placeholder doesn't work
> -
>
> Key: LOG4J2-2211
> URL: https://issues.apache.org/jira/browse/LOG4J2-2211
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Lookups
>Affects Versions: 2.10.0
> Environment: java: 1.7
> log4j: 2.10.0
> os : windows
>Reporter: wangzhongkuo
>Priority: Blocker
>  Labels: newbie
>
> I use the MainMapLookup like the 
> documentation([http://logging.apache.org/log4j/2.x/manual/lookups.html#AppMainArgsLookup),b|http://logging.apache.org/log4j/2.x/manual/lookups.html#AppMainArgsLookup),i]ut
>  the "${main:–file}" doesn't work, it replace the placeholder by default 
> value "-file".
> log4j2.xml(log4j2 2.10.0)
>  
> {code:java}
> 
> 
> 
> 
>  pattern="%d [%t] [${main:--file}] %-5level: %msg%n%throwable" />
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> im sure i have written the code: MainMapLookup.setMainArguments(args);
>  
> my program arguments are : --file foo.txt --verbose -x bar
> so i traced the source code, in StrSubstitutor.class line 958, it changes my 
> varName "main:–file" to "main". i can't understand the code : "varName = 
> varNameExpr.substring(0, i);"
> {code:java}
> if (valueDelimiterMatcher != null) {
> final char [] varNameExprChars = varNameExpr.toCharArray();
> int valueDelimiterMatchLen = 0;
> for (int i = 0; i < varNameExprChars.length; i++) {
> // if there's any nested variable when nested variable substitution disabled, 
> then stop resolving name and default value.
> if (!substitutionInVariablesEnabled
> && prefixMatcher.isMatch(varNameExprChars, i, i, varNameExprChars.length) != 
> 0) {
> break;
> }
> if ((valueDelimiterMatchLen = valueDelimiterMatcher.isMatch(varNameExprChars, 
> i)) != 0) {
> varName = varNameExpr.substring(0, i);
> varDefaultValue = varNameExpr.substring(i + valueDelimiterMatchLen);
> break;
> }
> }
> }
> {code}
> then org.apache.logging.log4j.core.lookup.Interpolator.class
>  
> {code:java}
> @Override
> public String lookup(final LogEvent event, String var) {
> if (var == null) {
> return null;
> }
> final int prefixPos = var.indexOf(PREFIX_SEPARATOR);
> if (prefixPos >= 0) {
> final String prefix = var.substring(0, prefixPos).toLowerCase(Locale.US);
> final String name = var.substring(prefixPos + 1);
> final StrLookup lookup = lookups.get(prefix);
> if (lookup instanceof ConfigurationAware) {
> ((ConfigurationAware) lookup).setConfiguration(configuration);
> }
> String value = null;
> if (lookup != null) {
> value = event == null ? lookup.lookup(name) : lookup.lookup(event, name);
> }
> if (value != null) {
> return value;
> }
> var = var.substring(prefixPos + 1);
> }
> if (defaultLookup != null) {
> return event == null ? defaultLookup.lookup(var) : 
> defaultLookup.lookup(event, var);
> }
> return null;
> }
> {code}
> in the red mark, var="main" and prefixPos=-1. so it return the default value 
> "-file";
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] logging-log4j2 issue #144: [LOG4J2-2211] Update StrSubstitutor.java

2018-01-25 Thread garydgregory
Github user garydgregory commented on the issue:

https://github.com/apache/logging-log4j2/pull/144
  
Hello,
The fastest way to get traction on this issue is to provide a unit test in 
this PR.
Gary


---


[jira] [Commented] (LOG4J2-2195) Cannot define both `filters` and `separator` for PatternLayout %xEx

2018-01-25 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-2195:
--

I can reproduce this. I will take a closer look.

> Cannot define both `filters` and `separator` for PatternLayout %xEx
> ---
>
> Key: LOG4J2-2195
> URL: https://issues.apache.org/jira/browse/LOG4J2-2195
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Pattern Converters
>Affects Versions: 2.10.0
>Reporter: Raman Gupta
>Assignee: Gary Gregory
>Priority: Minor
>
> Defining a pattern layout that contains:
> {{%xEx\{full,filters(${exceptionFilters}),separator(|)}}}
> does not work – the filters are applied but the separator is not.
> Only if the filters are removed does the separator apply to the layout.
> Reproduction recipe, including config file and test program here: 
> https://gist.github.com/rocketraman/9a92ce76ee79bf6a15ab9b3a5ec95e08
> Above you can see that the exception separator was not applied -- the default 
> newlines are present in the output instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (LOG4J2-2205) New module log4j-mongodb3: Remove use of deprecated MongoDB APIs and code to the Java driver version 3 API

2018-01-25 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory closed LOG4J2-2205.

   Resolution: Fixed
Fix Version/s: 2.11.0

Closing: In git master.

> New module log4j-mongodb3: Remove use of deprecated MongoDB APIs and code to 
> the Java driver version 3 API
> --
>
> Key: LOG4J2-2205
> URL: https://issues.apache.org/jira/browse/LOG4J2-2205
> Project: Log4j 2
>  Issue Type: Improvement
>  Components: Appenders, MongoDB
>Reporter: Gary Gregory
>Priority: Major
> Fix For: 2.11.0
>
>
> Add new module {{log4j-mongodb3}}.
> Remove use of deprecated MongoDB APIs and code to the Java driver version 3 
> API
> Deprecated call sites:
> {noformat}
> Description   ResourcePathLocationType
> The constructor MongoClient(ServerAddress, List) is 
> deprecated   MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 299  
>   Java Problem
> The method getDB(String) from the type Mongo is deprecated
> MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 250  
>   Java Problem
> The method getDB(String) from the type Mongo is deprecated
> MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 299  
>   Java Problem
> {noformat}
> As of commit {{b993a2138992f84ff834aa10a2e6b7640f3aa8d7}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (LOG4J2-2220) Log4j2 Causing Fatal Exception in Android Project

2018-01-25 Thread Mark Hoffner (JIRA)
Mark Hoffner created LOG4J2-2220:


 Summary: Log4j2 Causing Fatal Exception in Android Project
 Key: LOG4J2-2220
 URL: https://issues.apache.org/jira/browse/LOG4J2-2220
 Project: Log4j 2
  Issue Type: Bug
Affects Versions: 2.8, 2.7, 2.6, 2.5, 2.4, 2.3
 Environment: OS X El Capitan

IntelliJ IDEA 2017.3.3

Android SDK 26

JDK 8

Gradle 2.3
Reporter: Mark Hoffner


Moving a Java project with Maven over to an Android project with Gradle in 
IntelliJ and everything made the transition smoothly except for Log4j2.

This error message fires whenever the program tries to create a Logger:

{{java.lang.ExceptionInInitializerError at java.lang.Class.newInstance(Native 
Method) at android.app.Instrumentation.newActivity(Instrumentation.java:1078) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2538) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) at 
android.app.ActivityThread.-wrap12(ActivityThread.java) at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) at 
android.os.Handler.dispatchMessage(Handler.java:102) at 
android.os.Looper.loop(Looper.java:154) at 
android.app.ActivityThread.main(ActivityThread.java:6077) at 
java.lang.reflect.Method.invoke(Native Method) at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) Caused by: 
java.lang.NullPointerException: Attempt to get length of null array at 
org.apache.logging.log4j.util.ReflectionUtil$PrivateSecurityManager.getCallerClass(ReflectionUtil.java:301)
 at 
org.apache.logging.log4j.util.ReflectionUtil.getCallerClass(ReflectionUtil.java:214)
 at 
org.apache.logging.log4j.util.ReflectionUtil.getCallerClass(ReflectionUtil.java:193)
 at 
org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:72)
 at 
org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:195)
 at 
org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
 at org.apache.logging.log4j.LogManager.getContext(LogManager.java:160) at 
org.apache.logging.log4j.LogManager.getLogger(LogManager.java:492) at 
com.company.sample.MainActivity.(MainActivity.java:18) at 
java.lang.Class.newInstance(Native Method)  at 
android.app.Instrumentation.newActivity(Instrumentation.java:1078)  at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2538)  at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)  at 
android.app.ActivityThread.-wrap12(ActivityThread.java)  at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)  at 
android.os.Handler.dispatchMessage(Handler.java:102)  at 
android.os.Looper.loop(Looper.java:154)  at 
android.app.ActivityThread.main(ActivityThread.java:6077)  at 
java.lang.reflect.Method.invoke(Native Method)  at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) 
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) }}

Here's the build.gradle:

{{apply plugin: 'com.android.application' sourceCompatibility = 1.8 
targetCompatibility = 1.8 android { compileSdkVersion 26 buildToolsVersion 
"27.0.3" defaultConfig { applicationId "com.company.sample" minSdkVersion 15 
targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true } 
buildTypes { release { minifyEnabled false proguardFiles 
getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 
packagingOptions { pickFirst 'META-INF/DEPENDENCIES' pickFirst 
'META-INF/LICENSE' pickFirst 
'META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat' } 
dexOptions { javaMaxHeapSize "4g" } } repositories { flatDir { dirs 'libs' } } 
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
exclude group: 'com.android.support', module: 'support-annotations' }) compile 
'com.android.support:appcompat-v7:26.+' compile 
'com.android.support.constraint:constraint-layout:1.0.2' compile group: 
'org.apache.logging.log4j', name: 'log4j-api', version:'2.3' compile group: 
'org.apache.logging.log4j', name: 'log4j-core', version:'2.3' compile 
'com.android.support:multidex:1.0.1' compile group: 'org.testng', name: 
'testng', version: '6.13' compile group: 'org.mockito', name: 'mockito-core', 
version:'2.11.0' testCompile 'junit:junit:4.12' }}}

I was initially using SLF4J with Log4j2, but refactored to straight Log4j2 
while troubleshooting. When I use newer versions of Log4j2 I start getting:

{{Execution failed for task ':app:transformClassesWithDexForDebug'.}}

I updated to a newer version of Gradle and the Gradle plugin, but that gave 
similar task

[jira] [Commented] (LOG4J2-2205) New module log4j-mongodb3: Remove use of deprecated MongoDB APIs and code to the Java driver version 3 API

2018-01-25 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on LOG4J2-2205:
-

Commit e40e73e5d753fafab5b516130dd317cd36ba23db in logging-log4j2's branch 
refs/heads/master from [~garydgregory]
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=e40e73e ]

[LOG4J2-2205] New module log4j-mongodb3: Remove use of deprecated
MongoDB APIs and code to the Java driver version 3 API.

> New module log4j-mongodb3: Remove use of deprecated MongoDB APIs and code to 
> the Java driver version 3 API
> --
>
> Key: LOG4J2-2205
> URL: https://issues.apache.org/jira/browse/LOG4J2-2205
> Project: Log4j 2
>  Issue Type: Improvement
>  Components: Appenders, MongoDB
>Reporter: Gary Gregory
>Priority: Major
>
> Add new module {{log4j-mongodb3}}.
> Remove use of deprecated MongoDB APIs and code to the Java driver version 3 
> API
> Deprecated call sites:
> {noformat}
> Description   ResourcePathLocationType
> The constructor MongoClient(ServerAddress, List) is 
> deprecated   MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 299  
>   Java Problem
> The method getDB(String) from the type Mongo is deprecated
> MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 250  
>   Java Problem
> The method getDB(String) from the type Mongo is deprecated
> MongoDbProvider.java
> /log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb   line 299  
>   Java Problem
> {noformat}
> As of commit {{b993a2138992f84ff834aa10a2e6b7640f3aa8d7}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-1863) Add support for filtering input in TcpSocketServer and UdpSocketServer

2018-01-25 Thread Donatien RIVIERE (JIRA)

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

Donatien RIVIERE commented on LOG4J2-1863:
--

Log4j socket servers have been moved to "logging-log4j-tools" repository in a 
"log4j-server" project since 2.9.0.

But this artifact "org.apache.logging.log4j:log4j-server" is not published to 
any public maven repository, which makes it almost totally hidden, and unusable.

What is the plan about that ?

[https://git-wip-us.apache.org/repos/asf?p=logging-log4j-tools.git;a=tree;f=log4j-server;hb=HEAD]

> Add support for filtering input in TcpSocketServer and UdpSocketServer
> --
>
> Key: LOG4J2-1863
> URL: https://issues.apache.org/jira/browse/LOG4J2-1863
> Project: Log4j 2
>  Issue Type: New Feature
>  Components: Receivers
>Affects Versions: 2.8.1
>Reporter: Matt Sicker
>Assignee: Matt Sicker
>Priority: Major
> Fix For: 2.8.2
>
>
> It is best practice to add a configurable class filter to ObjectInputStream 
> usage when input comes from untrusted sources. Add this feature to 
> TcpSocketServer and UdpSocketServer along with sensible default settings. 
> This feature is unnecessary in JmsServer as that relies on the underlying 
> configuration of the JMS server (e.g., ActiveMQ has a similar configuration 
> option).
> h3. Security Details
> {code}
> CVE-2017-5645: Apache Log4j socket receiver deserialization vulnerability
> Severity: High
> CVSS Base Score: 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P)
> Vendor: The Apache Software Foundation
> Versions Affected: all versions from 2.0-alpha1 to 2.8.1
> Description: When using the TCP socket server or UDP socket server to receive 
> serialized log events from another application, a specially crafted binary 
> payload can be sent that, when deserialized, can execute arbitrary code.
> Mitigation: Java 7+ users should migrate to version 2.8.2 or avoid using the 
> socket server classes. Java 6 users should avoid using the TCP or UDP socket 
> server classes, or they can manually backport the security fix from 2.8.2: 
> 
> Credit: This issue was discovered by Marcio Almeida de Macedo of Red Team at 
> Telstra
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)