[ https://issues.apache.org/jira/browse/LOG4J2-1344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15221518#comment-15221518 ]
Remko Popma edited comment on LOG4J2-1344 at 4/1/16 10:58 AM: -------------------------------------------------------------- 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); } } // inner class private static class RollingFileManagerFactory implements ManagerFactory<RollingFileManager, FactoryData> { public RollingFileManager 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} was (Author: rem...@yahoo.com): 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-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org