You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zy...@apache.org on 2013/10/16 17:41:47 UTC

git commit: TS-2159: Force first log rotation at proxy.config.log.rolling_size_mb

Updated Branches:
  refs/heads/master 64b01e091 -> b942f3b94


TS-2159: Force first log rotation at proxy.config.log.rolling_size_mb


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b942f3b9
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b942f3b9
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b942f3b9

Branch: refs/heads/master
Commit: b942f3b942ea2a46279fda3a2d22e6f3c618780a
Parents: 64b01e0
Author: Zhao Yongming <mi...@gmail.com>
Authored: Wed Oct 16 18:06:23 2013 +0800
Committer: Zhao Yongming <mi...@gmail.com>
Committed: Wed Oct 16 23:40:44 2013 +0800

----------------------------------------------------------------------
 CHANGES                  | 2 ++
 proxy/logging/LogFile.cc | 3 +++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b942f3b9/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f892b2e..111c913 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-2159] Force first log rotation at proxy.config.log.rolling_size_mb
+
   *) [TS-2138] Fix the bug that restarting ats cause cache data loss if
   enable the native-aio.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b942f3b9/proxy/logging/LogFile.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc
index 55fe900..a567b93 100644
--- a/proxy/logging/LogFile.cc
+++ b/proxy/logging/LogFile.cc
@@ -261,6 +261,9 @@ LogFile::open_file()
     return LOG_FILE_FILESYSTEM_CHECKS_FAILED;
   }
 
+  // set m_bytes_written to force the rolling based on filesize.
+  m_bytes_written = lseek( m_fd, 0, SEEK_CUR );
+
   Debug("log-file", "LogFile %s is now open (fd=%d)", m_name, m_fd);
 
   //