ppkarwasz commented on issue #2023: URL: https://github.com/apache/logging-log4j2/issues/2023#issuecomment-1869496088
@tcmot, Thanks for the suggestion. Your solution will cause two system calls (a [`write`](https://man7.org/linux/man-pages/man2/write.2.html) and an [`fsync/fdatasync`](https://man7.org/linux/man-pages/man2/fsync.2.html) on Linux) to be issued for each log event. I would rather use: - the [`StandardOpenOption#DSYNC/SYNC`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/file/StandardOpenOption.html) option to `Files#newOutputStream`, - or the `rwd/rws` mode for `RandomAccessFile`. These have the advantage to delegate the syncing part to the OS, which can do it much more efficiently. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
