summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-12-16 17:14:30 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-12-16 17:14:30 +0000
commit2f4f05218183bbe4db291724d0fedd94f5afc09c (patch)
treecb34130a517f7d534f7ff9258a394d23960d4e6c
parente45e77a4e08b067326b966797dc152f2fb3bc05c (diff)
downloadqpid-python-2f4f05218183bbe4db291724d0fedd94f5afc09c.tar.gz
QPID-2274 : Addressed initial issues with Async compressing deleting log files
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@891322 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java b/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
index 7e0c4defe1..ea0fab17bd 100644
--- a/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
+++ b/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
@@ -749,16 +749,17 @@ public class QpidCompositeRollingAppender extends FileAppender
}
File file = new File(from);
- if (compress)
+ if (!file.getPath().equals(target.getPath()))
{
- compress(file, target);
+ file.renameTo(target);
}
- else
+
+ // Compress file after it has been moved out the way... this is safe
+ // as it will gain a .gz ending and we can then safely delete this file
+ // as it will not be the statically named value.
+ if (compress)
{
- if (!file.getPath().equals(target.getPath()))
- {
- file.renameTo(target);
- }
+ compress(to);
}
LogLog.debug(from + " -> " + to);