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] [Comment Edited] (LOG4J2-1343) Update ConsoleAppender to utilize gc-free Layout method
Date Wed, 06 Apr 2016 07:00:34 GMT

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

Remko Popma edited comment on LOG4J2-1343 at 4/6/16 6:59 AM:
-------------------------------------------------------------

More notes to self:

* We need an adapter class that implements ByteBufferDestination which spills over to the
OutputStreamManager.write(byte[] bytes, int offset, int length, boolean immediateFlush) method,
so it needs to know whether the appender wants to immediateFlush or not.
* The other write(...) methods in OutputStreamManager need to drain the buffer into the write(byte[]
bytes, int offset, int length, boolean immediateFlush) method before writing the requested
bytes.
* Some OutputStreamManager subclasses currently buffer the OutputStream. When using ByteBufferDestination
we should not use BufferedOutputStream (to avoid unnecessary copying between buffers).
* OutputStreamManager subclasses that currently buffer IO should honor the specified buffer
size in their ByteBufferDestination.
* OutputStreamManager subclasses that are _not_ buffered expect to see the data immediately
in the OutputStream. In these cases the ByteBuffer should be drained when Layout.encode()
completes. Otherwise the ByteBuffer should only be drained when it is full or when the Manager's
flush() method is called.
* RandomAccessFileManager is different since its write(...) method writes to a buffer. Here
the ByteBufferDestination adapter class's drain() method should not spill over to the write()
method but to the destination file directly.


was (Author: remkop@yahoo.com):
More notes to self:

* We need an adapter class that implements ByteBufferDestination which spills over to the
OutputStreamManager.write(byte[] bytes, int offset, int length, boolean immediateFlush) method,
so it needs to know whether the appender wants to immediateFlush or not.
* Some OutputStreamManager subclasses currently buffer the OutputStream. When using ByteBufferDestination
we should not use BufferedOutputStream (to avoid unnecessary copying between buffers).
* OutputStreamManager subclasses that currently buffer IO should honor the specified buffer
size in their ByteBufferDestination.
* OutputStreamManager subclasses that are _not_ buffered expect to see the data immediately
in the OutputStream. In these cases the ByteBuffer should be drained when Layout.encode()
completes. Otherwise the ByteBuffer should only be drained when it is full or when the Manager's
flush() method is called.
* RandomAccessFileManager is different since its write(...) method writes to a buffer. Here
the ByteBufferDestination adapter class's drain() method should not spill over to the write()
method but to the destination file directly.

> Update ConsoleAppender to utilize gc-free Layout method
> -------------------------------------------------------
>
>                 Key: LOG4J2-1343
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1343
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 2.5
>            Reporter: Remko Popma
>            Assignee: 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