Skip to content

Consider replacing FileOutputStream with Files.newOutputStream #2117

Open
@ppkarwasz

Description

@ppkarwasz

Since Java 7 two methods are available to open new files:

While they mostly perform the same OS operations, there is a significant difference between the two on Windows: the IO method opens the file without the FILE_SHARE_DELETE option, whereas the NIO method adds the FILE_SHARE_DELETE option (cf. this SO question).

Since log files on UNIX can already be deleted without stopping the application, this change would allow an alignment between the behavior of Log4j on Windows and UNIX.

I discussed this with @garydgregory on Slack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appendersAffects one or more Appender pluginsenhancementAdditions or updates to featuresruntimeSpecific to the runtime environment

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions