You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2015/07/31 03:05:52 UTC

trafficserver git commit: TS-3749: Re-enable error log.

Repository: trafficserver
Updated Branches:
  refs/heads/master 213a70036 -> 792a75b1a


TS-3749: Re-enable error log.


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

Branch: refs/heads/master
Commit: 792a75b1aa348b0d51256635a54f6ff534a8dcf8
Parents: 213a700
Author: Phil Sorber <so...@apache.org>
Authored: Thu Jul 30 18:54:14 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Thu Jul 30 18:54:14 2015 -0600

----------------------------------------------------------------------
 proxy/logging/LogConfig.cc | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/792a75b1/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index aa5d160..bb31695 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -446,7 +446,21 @@ LogConfig::init(LogConfig *prev_config)
   }
 
   // ----------------------------------------------------------------------
-  Log::error_log = NULL;
+  // Construct a new error log object candidate.
+  if (Log::error_logging_enabled()) {
+    LogFormat *fmt;
+
+    Debug("log", "creating predefined error log object");
+
+    fmt = MakeTextLogFormat("error");
+    this->global_format_list.add(fmt, false);
+    errlog = new LogObject(fmt, logfile_dir, "error.log", LOG_FILE_ASCII, NULL, (Log::RollingEnabledValues)rolling_enabled,
+                           collation_preproc_threads, rolling_interval_sec, rolling_offset_hr, rolling_size_mb);
+    log_object_manager.manage_object(errlog);
+    errlog->set_fmt_timestamps();
+  } else {
+    Log::error_log = NULL;
+  }
 
   if (prev_config) {
     // Transfer objects from previous configuration.