logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (LOG4J2-1412) Unbox ringbuffer size should be configurable
Date Tue, 07 Jun 2016 04:28:20 GMT

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

Remko Popma closed LOG4J2-1412.
-------------------------------

> Unbox ringbuffer size should be configurable
> --------------------------------------------
>
>                 Key: LOG4J2-1412
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1412
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: 2.6, 2.6.1
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>             Fix For: 2.6.2
>
>
> The Unbox utility is meant to be used for primitive parameters to a logging call with
a parameterized message, for example {{logger.debug("pi is {}", Unbox.box(Double.PI))}}.
> Unbox is implemented with a ThreadLocal a ringbuffer of StringBuilders. By default, the
ringbuffer has 16 slots. After 16 calls to {{Unbox.box()}} it reuses the first StringBuilder
again, so there is a limit to how many things can be boxed before the call to Message.getFormattedMessage()
breaks.
> This needs to be better documented in the Unbox javadoc and the garbage-free manual page.
Furthermore, there should be a mechanism to allow users to increase the size of the ringbuffer.
> Finally, if Constants.ENABLE_THREADLOCALS is false we should not store non-JDK classes
in ThreadLocals. The Unbox.State class breaks that principle.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message