[jira] [Commented] (LOG4J2-2032) Curly braces in parameters are treated as placeholders

2018-04-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LOG4J2-2032:


Github user kshchepanovskyi closed the pull request at:

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


> Curly braces in parameters are treated as placeholders
> --
>
> Key: LOG4J2-2032
> URL: https://issues.apache.org/jira/browse/LOG4J2-2032
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders, Layouts
>Affects Versions: 2.8.2, 2.9.0, 2.10.0
> Environment: Tested on Windows and Linux.
> java version "1.8.0_144"
> Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
>Reporter: Kostiantyn Shchepanovskyi
>Assignee: Carter Kozak
>Priority: Major
> Fix For: 3.0.0
>
>
> When logging event parameter contains two consecutive opening and closing 
> curly braces - {{for example {} in the middle of parameter}}, they are 
> treated as a placeholder and are substituted by provided parameters starting 
> from index zero.
> I suspect that it affects only async loggers.
> My configuration:
> {code:xml}
> 
> 
> 
> 
> 
> %level{length=1} %date{MMdd-HHmm:ss,SSS} %logger{1.} 
> %message %X [%thread]%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> Test:
> {code:java}
> package com.playtech.live.platform.core.service;
> import org.junit.jupiter.api.Test;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> public class Log4jCurlyBracesInParameterTest {
> private static final Logger LOGGER = 
> LoggerFactory.getLogger(Log4jCurlyBracesInParameterTest.class);
> @Test
> void messageWithCurlyBracesInParameter() {
> LOGGER.info("Text containing curly braces: {}", "Curly{}");
> LOGGER.info("Normal text: {}, text containing curly braces {}", 
> "Normal", "Curly{}");
> }
> }
> {code}
> Expected output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: Curly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces Curly{} {} [main]
> {code}
> Actual output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: CurlyCurly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces CurlyNormal {} [main]
> {code}



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


[jira] [Commented] (LOG4J2-2032) Curly braces in parameters are treated as placeholders

2018-04-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LOG4J2-2032:


Github user kshchepanovskyi commented on the issue:

https://github.com/apache/logging-log4j2/pull/147
  
Thanks!


> Curly braces in parameters are treated as placeholders
> --
>
> Key: LOG4J2-2032
> URL: https://issues.apache.org/jira/browse/LOG4J2-2032
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders, Layouts
>Affects Versions: 2.8.2, 2.9.0, 2.10.0
> Environment: Tested on Windows and Linux.
> java version "1.8.0_144"
> Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
>Reporter: Kostiantyn Shchepanovskyi
>Assignee: Carter Kozak
>Priority: Major
> Fix For: 3.0.0
>
>
> When logging event parameter contains two consecutive opening and closing 
> curly braces - {{for example {} in the middle of parameter}}, they are 
> treated as a placeholder and are substituted by provided parameters starting 
> from index zero.
> I suspect that it affects only async loggers.
> My configuration:
> {code:xml}
> 
> 
> 
> 
> 
> %level{length=1} %date{MMdd-HHmm:ss,SSS} %logger{1.} 
> %message %X [%thread]%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> Test:
> {code:java}
> package com.playtech.live.platform.core.service;
> import org.junit.jupiter.api.Test;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> public class Log4jCurlyBracesInParameterTest {
> private static final Logger LOGGER = 
> LoggerFactory.getLogger(Log4jCurlyBracesInParameterTest.class);
> @Test
> void messageWithCurlyBracesInParameter() {
> LOGGER.info("Text containing curly braces: {}", "Curly{}");
> LOGGER.info("Normal text: {}, text containing curly braces {}", 
> "Normal", "Curly{}");
> }
> }
> {code}
> Expected output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: Curly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces Curly{} {} [main]
> {code}
> Actual output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: CurlyCurly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces CurlyNormal {} [main]
> {code}



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


[jira] [Commented] (LOG4J2-2032) Curly braces in parameters are treated as placeholders

2018-04-07 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-2032:
-

Thanks, [~kshchepanovskyi] and [~ckozak]!

> Curly braces in parameters are treated as placeholders
> --
>
> Key: LOG4J2-2032
> URL: https://issues.apache.org/jira/browse/LOG4J2-2032
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders, Layouts
>Affects Versions: 2.8.2, 2.9.0, 2.10.0
> Environment: Tested on Windows and Linux.
> java version "1.8.0_144"
> Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
>Reporter: Kostiantyn Shchepanovskyi
>Assignee: Carter Kozak
>Priority: Major
> Fix For: 3.0.0
>
>
> When logging event parameter contains two consecutive opening and closing 
> curly braces - {{for example {} in the middle of parameter}}, they are 
> treated as a placeholder and are substituted by provided parameters starting 
> from index zero.
> I suspect that it affects only async loggers.
> My configuration:
> {code:xml}
> 
> 
> 
> 
> 
> %level{length=1} %date{MMdd-HHmm:ss,SSS} %logger{1.} 
> %message %X [%thread]%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> Test:
> {code:java}
> package com.playtech.live.platform.core.service;
> import org.junit.jupiter.api.Test;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> public class Log4jCurlyBracesInParameterTest {
> private static final Logger LOGGER = 
> LoggerFactory.getLogger(Log4jCurlyBracesInParameterTest.class);
> @Test
> void messageWithCurlyBracesInParameter() {
> LOGGER.info("Text containing curly braces: {}", "Curly{}");
> LOGGER.info("Normal text: {}, text containing curly braces {}", 
> "Normal", "Curly{}");
> }
> }
> {code}
> Expected output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: Curly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces Curly{} {} [main]
> {code}
> Actual output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: CurlyCurly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces CurlyNormal {} [main]
> {code}



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


[jira] [Commented] (LOG4J2-2032) Curly braces in parameters are treated as placeholders

2018-02-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LOG4J2-2032:


Github user kshchepanovskyi commented on the issue:

https://github.com/apache/logging-log4j2/pull/147
  
Travis build fails with

```
$ ./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 .
```

Definitely not related to changes I did.


> Curly braces in parameters are treated as placeholders
> --
>
> Key: LOG4J2-2032
> URL: https://issues.apache.org/jira/browse/LOG4J2-2032
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders, Layouts
>Affects Versions: 2.8.2, 2.9.0, 2.10.0
> Environment: Tested on Windows and Linux.
> java version "1.8.0_144"
> Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
>Reporter: Kostiantyn Shchepanovskyi
>Priority: Major
>
> When logging event parameter contains two consecutive opening and closing 
> curly braces - {{for example {} in the middle of parameter}}, they are 
> treated as a placeholder and are substituted by provided parameters starting 
> from index zero.
> I suspect that it affects only async loggers.
> My configuration:
> {code:xml}
> 
> 
> 
> 
> 
> %level{length=1} %date{MMdd-HHmm:ss,SSS} %logger{1.} 
> %message %X [%thread]%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> Test:
> {code:java}
> package com.playtech.live.platform.core.service;
> import org.junit.jupiter.api.Test;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> public class Log4jCurlyBracesInParameterTest {
> private static final Logger LOGGER = 
> LoggerFactory.getLogger(Log4jCurlyBracesInParameterTest.class);
> @Test
> void messageWithCurlyBracesInParameter() {
> LOGGER.info("Text containing curly braces: {}", "Curly{}");
> LOGGER.info("Normal text: {}, text containing curly braces {}", 
> "Normal", "Curly{}");
> }
> }
> {code}
> Expected output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: Curly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces Curly{} {} [main]
> {code}
> Actual output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: CurlyCurly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces CurlyNormal {} [main]
> {code}



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


[jira] [Commented] (LOG4J2-2032) Curly braces in parameters are treated as placeholders

2018-02-06 Thread Kostiantyn Shchepanovskyi (JIRA)

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

Kostiantyn Shchepanovskyi commented on LOG4J2-2032:
---

[~ralph.go...@dslextreme.com] 

Can you please take a look at https://github.com/apache/logging-log4j2/pull/147?

> Curly braces in parameters are treated as placeholders
> --
>
> Key: LOG4J2-2032
> URL: https://issues.apache.org/jira/browse/LOG4J2-2032
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders, Layouts
>Affects Versions: 2.8.2, 2.9.0, 2.10.0
> Environment: Tested on Windows and Linux.
> java version "1.8.0_144"
> Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
>Reporter: Kostiantyn Shchepanovskyi
>Priority: Major
>
> When logging event parameter contains two consecutive opening and closing 
> curly braces - {{for example {} in the middle of parameter}}, they are 
> treated as a placeholder and are substituted by provided parameters starting 
> from index zero.
> I suspect that it affects only async loggers.
> My configuration:
> {code:xml}
> 
> 
> 
> 
> 
> %level{length=1} %date{MMdd-HHmm:ss,SSS} %logger{1.} 
> %message %X [%thread]%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> Test:
> {code:java}
> package com.playtech.live.platform.core.service;
> import org.junit.jupiter.api.Test;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> public class Log4jCurlyBracesInParameterTest {
> private static final Logger LOGGER = 
> LoggerFactory.getLogger(Log4jCurlyBracesInParameterTest.class);
> @Test
> void messageWithCurlyBracesInParameter() {
> LOGGER.info("Text containing curly braces: {}", "Curly{}");
> LOGGER.info("Normal text: {}, text containing curly braces {}", 
> "Normal", "Curly{}");
> }
> }
> {code}
> Expected output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: Curly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces Curly{} {} [main]
> {code}
> Actual output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: CurlyCurly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces CurlyNormal {} [main]
> {code}



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


[jira] [Commented] (LOG4J2-2032) Curly braces in parameters are treated as placeholders

2018-02-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LOG4J2-2032:


GitHub user kshchepanovskyi opened a pull request:

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

LOG4J2-2032 Curly braces in parameters should not be treated as placeholders

https://issues.apache.org/jira/browse/LOG4J2-2032

When logging event parameter contains two consecutive opening and
closing curly braces - for example {} in the middle of parameter,
they should not be treated as a placeholder.

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

$ git pull https://github.com/kshchepanovskyi/logging-log4j2 
fix/double-placeholder-processing

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

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


commit b68f797ea01e669fc4b4c630cd7a96e14f4cc6ef
Author: Kostiantyn Shchepanovskyi 
Date:   2018-02-06T10:20:35Z

LOG4J2-2032 Fix SslConfigurationTest running on Windows behind proxy

Corporate proxies might not allow connection to external resources.

commit 3814afe7d81ed065b1ecb3e593547c32d4536ddd
Author: Kostiantyn Shchepanovskyi 
Date:   2018-02-06T11:26:00Z

LOG4J2-2032 Curly braces in parameters should not be treated as placeholders

When logging event parameter contains two consecutive opening and
closing curly braces - for example {} in the middle of parameter,
they should not be treated as a placeholder.




> Curly braces in parameters are treated as placeholders
> --
>
> Key: LOG4J2-2032
> URL: https://issues.apache.org/jira/browse/LOG4J2-2032
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders, Layouts
>Affects Versions: 2.8.2, 2.9.0, 2.10.0
> Environment: Tested on Windows and Linux.
> java version "1.8.0_144"
> Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
>Reporter: Kostiantyn Shchepanovskyi
>Priority: Major
>
> When logging event parameter contains two consecutive opening and closing 
> curly braces - {{for example {} in the middle of parameter}}, they are 
> treated as a placeholder and are substituted by provided parameters starting 
> from index zero.
> I suspect that it affects only async loggers.
> My configuration:
> {code:xml}
> 
> 
> 
> 
> 
> %level{length=1} %date{MMdd-HHmm:ss,SSS} %logger{1.} 
> %message %X [%thread]%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> Test:
> {code:java}
> package com.playtech.live.platform.core.service;
> import org.junit.jupiter.api.Test;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> public class Log4jCurlyBracesInParameterTest {
> private static final Logger LOGGER = 
> LoggerFactory.getLogger(Log4jCurlyBracesInParameterTest.class);
> @Test
> void messageWithCurlyBracesInParameter() {
> LOGGER.info("Text containing curly braces: {}", "Curly{}");
> LOGGER.info("Normal text: {}, text containing curly braces {}", 
> "Normal", "Curly{}");
> }
> }
> {code}
> Expected output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: Curly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces Curly{} {} [main]
> {code}
> Actual output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: CurlyCurly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces CurlyNormal {} [main]
> {code}



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


[jira] [Commented] (LOG4J2-2032) Curly braces in parameters are treated as placeholders

2018-02-05 Thread Kostiantyn Shchepanovskyi (JIRA)

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

Kostiantyn Shchepanovskyi commented on LOG4J2-2032:
---

Looks like this issue has been introduced by 
https://issues.apache.org/jira/browse/LOG4J2-1342.

{code:java}
@Override
public Message memento() {
if (message != null) {
return message;
}
final Object[] params = parameters == null ? new Object[0] : 
Arrays.copyOf(parameters, parameterCount);
return new ParameterizedMessage(messageText.toString(), params);
}
{code}

Returning {{ParameterizedMessage(messageText.toString(), params)}} is wrong, as 
{{messageText.toString()}} is already processed. 
If we return new message with parameters and this text as format, resulting 
string is invalid.

[~rem...@yahoo.com] - I would appreciate any hints how to fix this issue in 
optimal way.


> Curly braces in parameters are treated as placeholders
> --
>
> Key: LOG4J2-2032
> URL: https://issues.apache.org/jira/browse/LOG4J2-2032
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders, Layouts
>Affects Versions: 2.8.2, 2.9.0
> Environment: Tested on Windows and Linux.
> java version "1.8.0_144"
> Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
>Reporter: Kostiantyn Shchepanovskyi
>Priority: Major
>
> When logging event parameter contains two consecutive opening and closing 
> curly braces - {{for example {} in the middle of parameter}}, they are 
> treated as a placeholder and are substituted by provided parameters starting 
> from index zero.
> I suspect that it affects only async loggers.
> My configuration:
> {code:xml}
> 
> 
> 
> 
> 
> %level{length=1} %date{MMdd-HHmm:ss,SSS} %logger{1.} 
> %message %X [%thread]%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> Test:
> {code:java}
> package com.playtech.live.platform.core.service;
> import org.junit.jupiter.api.Test;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> public class Log4jCurlyBracesInParameterTest {
> private static final Logger LOGGER = 
> LoggerFactory.getLogger(Log4jCurlyBracesInParameterTest.class);
> @Test
> void messageWithCurlyBracesInParameter() {
> LOGGER.info("Text containing curly braces: {}", "Curly{}");
> LOGGER.info("Normal text: {}, text containing curly braces {}", 
> "Normal", "Curly{}");
> }
> }
> {code}
> Expected output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: Curly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces Curly{} {} [main]
> {code}
> Actual output:
> {code}
> I 0905-1731:01,018 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Text 
> containing curly braces: CurlyCurly{} {} [main]
> I 0905-1731:01,033 c.p.l.p.c.s.Log4jCurlyBracesInParameterTest Normal text: 
> Normal, text containing curly braces CurlyNormal {} [main]
> {code}



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