[jira] [Commented] (LOG4J2-1873) Implement UTF-8 encoding that doesn't use CharsetEncoder

2017-04-10 Thread Roman Leventov (JIRA)

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

Roman Leventov commented on LOG4J2-1873:


Or implementation from Apache Harmony: 
https://github.com/apache/harmony-classlib/blob/15867416ca717a9910abb787989205223f5b1f09/modules/nio_char/src/main/java/org/apache/harmony/niochar/charset/UTF_8.java#L219

> Implement UTF-8 encoding that doesn't use CharsetEncoder
> 
>
> Key: LOG4J2-1873
> URL: https://issues.apache.org/jira/browse/LOG4J2-1873
> Project: Log4j 2
>  Issue Type: Improvement
>Reporter: Roman Leventov
>
> CharsetEncoder accepts only CharBuffers, and for the sake of being entirely 
> garbage-free we don't want to use CharBuffer.wrap(stringBuilder), when 
> encoding an event.
> That forces us to make additional data copy from StringBuilder to a 
> thread-local CharBuffer.
> This could be avoided by implementing UTF-8 encoding logic in log4j-core 
> itself, and not using CharsetEncoder.
> This issue is specifically about UTF-8 because it is used predominantly and 
> it's relatively easy to implement. There are also likely some open-source 
> Apache 2-compatible implementations in Java out there already that we could 
> just copy and adapt.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1873) Implement UTF-8 encoding that doesn't use CharsetEncoder

2017-04-10 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOG4J2-1873:
--

ICU4J might have something we can optionally depend on or copy.

> Implement UTF-8 encoding that doesn't use CharsetEncoder
> 
>
> Key: LOG4J2-1873
> URL: https://issues.apache.org/jira/browse/LOG4J2-1873
> Project: Log4j 2
>  Issue Type: Improvement
>Reporter: Roman Leventov
>
> CharsetEncoder accepts only CharBuffers, and for the sake of being entirely 
> garbage-free we don't want to use CharBuffer.wrap(stringBuilder), when 
> encoding an event.
> That forces us to make additional data copy from StringBuilder to a 
> thread-local CharBuffer.
> This could be avoided by implementing UTF-8 encoding logic in log4j-core 
> itself, and not using CharsetEncoder.
> This issue is specifically about UTF-8 because it is used predominantly and 
> it's relatively easy to implement. There are also likely some open-source 
> Apache 2-compatible implementations in Java out there already that we could 
> just copy and adapt.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1873) Implement UTF-8 encoding that doesn't use CharsetEncoder

2017-04-10 Thread Matt Sicker (JIRA)

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

Matt Sicker commented on LOG4J2-1873:
-

I'd be interested in seeing this feature myself. The standard UTF-8 
CharsetEncoder is ridiculous in this regard.

> Implement UTF-8 encoding that doesn't use CharsetEncoder
> 
>
> Key: LOG4J2-1873
> URL: https://issues.apache.org/jira/browse/LOG4J2-1873
> Project: Log4j 2
>  Issue Type: Improvement
>Reporter: Roman Leventov
>
> CharsetEncoder accepts only CharBuffers, and for the sake of being entirely 
> garbage-free we don't want to use CharBuffer.wrap(stringBuilder), when 
> encoding an event.
> That forces us to make additional data copy from StringBuilder to a 
> thread-local CharBuffer.
> This could be avoided by implementing UTF-8 encoding logic in log4j-core 
> itself, and not using CharsetEncoder.
> This issue is specifically about UTF-8 because it is used predominantly and 
> it's relatively easy to implement. There are also likely some open-source 
> Apache 2-compatible implementations in Java out there already that we could 
> just copy and adapt.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1873) Implement UTF-8 encoding that doesn't use CharsetEncoder

2017-04-10 Thread Roman Leventov (JIRA)

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

Roman Leventov commented on LOG4J2-1873:


[~rem...@yahoo.com] Yes, I think it would be something like 
"Utf8StringBuilderEncoder".

> Implement UTF-8 encoding that doesn't use CharsetEncoder
> 
>
> Key: LOG4J2-1873
> URL: https://issues.apache.org/jira/browse/LOG4J2-1873
> Project: Log4j 2
>  Issue Type: Improvement
>Reporter: Roman Leventov
>
> CharsetEncoder accepts only CharBuffers, and for the sake of being entirely 
> garbage-free we don't want to use CharBuffer.wrap(stringBuilder), when 
> encoding an event.
> That forces us to make additional data copy from StringBuilder to a 
> thread-local CharBuffer.
> This could be avoided by implementing UTF-8 encoding logic in log4j-core 
> itself, and not using CharsetEncoder.
> This issue is specifically about UTF-8 because it is used predominantly and 
> it's relatively easy to implement. There are also likely some open-source 
> Apache 2-compatible implementations in Java out there already that we could 
> just copy and adapt.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1873) Implement UTF-8 encoding that doesn't use CharsetEncoder

2017-04-10 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOG4J2-1873:
-

I'm open to ideas. 
We did something similar with core.util.StringEncoder for 8859-1 but that's not 
used on the garbage-free path. Would this be an enhancement or replacement of 
StringBuilderEncoder or something else entirely?


> Implement UTF-8 encoding that doesn't use CharsetEncoder
> 
>
> Key: LOG4J2-1873
> URL: https://issues.apache.org/jira/browse/LOG4J2-1873
> Project: Log4j 2
>  Issue Type: Improvement
>Reporter: Roman Leventov
>
> CharsetEncoder accepts only CharBuffers, and for the sake of being entirely 
> garbage-free we don't want to use CharBuffer.wrap(stringBuilder), when 
> encoding an event.
> That forces us to make additional data copy from StringBuilder to a 
> thread-local CharBuffer.
> This could be avoided by implementing UTF-8 encoding logic in log4j-core 
> itself, and not using CharsetEncoder.
> This issue is specifically about UTF-8 because it is used predominantly and 
> it's relatively easy to implement. There are also likely some open-source 
> Apache 2-compatible implementations in Java out there already that we could 
> just copy and adapt.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org