Github user benji commented on a diff in the pull request:
https://github.com/apache/logging-log4j2/pull/107#discussion_r133093011
--- Diff:
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java
---
@@ -124,11 +124,12 @@ public static boolean execute(final File source,
final File destination, final b
} catch (final IOException exMove) {
LOGGER.error("Unable to move file {} to {}: {} {}",
source.getAbsolutePath(),
destination.getAbsolutePath(),
exMove.getClass().getName(), exMove.getMessage());
- final boolean result = source.renameTo(destination);
+ boolean result = source.renameTo(destination);
if (!result) {
try {
Files.copy(Paths.get(source.getAbsolutePath()),
Paths.get(destination.getAbsolutePath()),
StandardCopyOption.REPLACE_EXISTING);
+ result = true;
--- End diff --
Maybe, I considered it but in my case I'd rather compress the destination
file even if the source file has not been deleted successfully. I can change
that if you want to only succeed when the delete has been successful has well.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---