diff --git a/include/triton/core/tritonserver.h b/include/triton/core/tritonserver.h index 3a04fbf6b..acd2b2f53 100644 --- a/include/triton/core/tritonserver.h +++ b/include/triton/core/tritonserver.h @@ -259,13 +259,31 @@ typedef enum TRITONSERVER_loglevel_enum { TRITONSERVER_LOG_VERBOSE } TRITONSERVER_LogLevel; +/// Logging Formats /// -/// Format of logging. +/// The TRITONSERVER API offers two logging formats. The formats have +/// a common set of fields but differ in how the timestamp for a log +/// entry is represented. Messages are serialized according to JSON +/// encoding rules by default. This behavior can be disabled by +/// setting the environment variable TRITON_SERVER_ESCAPE_LOG_MESSAGES +/// to "0". /// -/// TRITONSERVER_LOG_DEFAULT: the log severity (L) and timestamp will be -/// logged as "LMMDD hh:mm:ss.ssssss". /// -/// TRITONSERVER_LOG_ISO8601: the log format will be "YYYY-MM-DDThh:mm:ssZ L". +/// 1. TRITONSERVER_LOG_DEFAULT +/// +/// ::. :] +/// +/// Example: +/// +/// I0520 20:03:25.829575 3355 model_lifecycle.cc:441] "AsyncLoad() 'simple'" +/// +/// 2. TRITONSERVER_LOG_ISO8601 +/// +/// --T::Z :] +/// +/// Example: +/// +/// 2024-05-20T20:03:26Z I 3415 model_lifecycle.cc:441] "AsyncLoad() 'simple'" /// typedef enum TRITONSERVER_logformat_enum { TRITONSERVER_LOG_DEFAULT, diff --git a/src/model_config_utils.cc b/src/model_config_utils.cc index d24a3b3e1..598d1894f 100644 --- a/src/model_config_utils.cc +++ b/src/model_config_utils.cc @@ -677,8 +677,8 @@ GetNormalizedModelConfig( // to auto-complete. RETURN_IF_ERROR( AutoCompleteBackendFields(model_name, std::string(path), config)); - LOG_VERBOSE(1) << "Server side auto-completed config: " - << config->DebugString(); + + LOG_PROTOBUF_VERBOSE(1, "Server side auto-completed config: ", (*config)); RETURN_IF_ERROR(NormalizeModelConfig(min_compute_capability, config)); diff --git a/src/server.cc b/src/server.cc index afe3f3cde..00eccedc4 100644 --- a/src/server.cc +++ b/src/server.cc @@ -603,8 +603,7 @@ InferenceServer::PrintBackendAndModelSummary() repoagent_record.emplace_back(repoagent_pair.second); repoagents_table.InsertRow(repoagent_record); } - std::string repoagents_table_string = repoagents_table.PrintTable(); - LOG_INFO << repoagents_table_string; + LOG_TABLE_INFO(repoagents_table); // Backends Summary std::vector backend_headers; @@ -630,8 +629,8 @@ InferenceServer::PrintBackendAndModelSummary() } backends_table.InsertRow(backend_record); } - std::string backends_table_string = backends_table.PrintTable(); - LOG_INFO << backends_table_string; + + LOG_TABLE_INFO(backends_table); // Models Summary auto model_states = model_repository_manager_->ModelStates(); @@ -673,8 +672,8 @@ InferenceServer::PrintBackendAndModelSummary() } } } - std::string models_table_string = models_table.PrintTable(); - LOG_INFO << models_table_string; + + LOG_TABLE_INFO(models_table); return Status::Success; } diff --git a/src/tritonserver.cc b/src/tritonserver.cc index 28d19143f..442806b02 100644 --- a/src/tritonserver.cc +++ b/src/tritonserver.cc @@ -2554,8 +2554,7 @@ TRITONSERVER_ServerNew( options_table.InsertRow(std::vector{ "cache_enabled", std::to_string(lserver->ResponseCacheEnabled())}); - std::string options_table_string = options_table.PrintTable(); - LOG_INFO << options_table_string; + LOG_TABLE_INFO(options_table); if (!status.IsOk()) { if (loptions->ExitOnError()) {