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] [Commented] (LOG4J2-1344) Update FileAppender to utilize gc-free Layout method
Date Fri, 01 Apr 2016 10:33:25 GMT

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

Remko Popma commented on LOG4J2-1344:
-------------------------------------

Note to self on how to approach this (draft):

FileManager
{code}
...
@Override
protected ByteBuffer createByteBuffer() {
    return bufferSize > 0 ? ByteBuffer.wrap(new byte[bufferSize]) : super.createByteBuffer();
}

...
// inner class
private static class FileManagerFactory implements ManagerFactory<FileManager, FactoryData>
{
...
  public FileManager createManager(final String name, final FactoryData data) {
  ...
                // if Constants.ENABLE_THREADLOCALS is true,
                // we use ByteBufferDestination to buffer the data
                if (data.bufferedIO && !Constants.ENABLE_THREADLOCALS) {
                    os = new BufferedOutputStream(os, bufferSize);
                } else {
  ...
{code}

RollingFileManager
{code}
protected void createFileAfterRollover() throws IOException  {
    final OutputStream os = new FileOutputStream(getFileName(), isAppend());

    // if Constants.ENABLE_THREADLOCALS is true,
    // we use ByteBuffer to buffer the data.
    // Negative buffer size means no buffering.
    if (getBufferSize() > 0 && !Constants.ENABLE_THREADLOCALS) {
        setOutputStream(new BufferedOutputStream(os, getBufferSize()));
    } else {
        setOutputStream(os);
    }
}
{code}


> Update FileAppender to utilize gc-free Layout method
> ----------------------------------------------------
>
>                 Key: LOG4J2-1344
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1344
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 2.5
>            Reporter: Remko Popma
>
> TBD: would we want to include this in the upcoming 2.6 release?



--
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