Skip to content

Commit

Permalink
Change the format to json for logging config (envoyproxy#1808)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwzhang authored and istio-testing committed Jun 8, 2018
1 parent 0f38765 commit 5317cae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/envoy/http/jwt_auth/auth_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#pragma once

#include "common/common/logger.h"
#include "common/protobuf/utility.h"
#include "envoy/config/filter/http/jwt_auth/v2alpha1/config.pb.h"
#include "envoy/server/filter_config.h"
#include "envoy/thread_local/thread_local.h"
Expand Down Expand Up @@ -70,7 +71,8 @@ class JwtAuthStoreFactory : public Logger::Loggable<Logger::Id::config> {
[this](Event::Dispatcher&) -> ThreadLocal::ThreadLocalObjectSharedPtr {
return std::make_shared<JwtAuthStore>(config_);
});
ENVOY_LOG(info, "Loaded JwtAuthConfig: {}", config_.DebugString());
ENVOY_LOG(info, "Loaded JwtAuthConfig: {}",
MessageUtil::getJsonStringFromMessage(config_, true));
}

// Get per-thread auth store object.
Expand Down
3 changes: 2 additions & 1 deletion src/envoy/http/mixer/filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "src/envoy/http/mixer/filter.h"

#include "common/common/base64.h"
#include "common/protobuf/utility.h"
#include "include/istio/utils/status.h"
#include "src/envoy/http/mixer/check_data.h"
#include "src/envoy/http/mixer/report_data.h"
Expand Down Expand Up @@ -114,7 +115,7 @@ void Filter::ReadPerRouteConfig(
control_.controller()->AddServiceConfig(config->service_config_id, config_pb);
ENVOY_LOG(info, "Service {}, config_id {}, config: {}",
config->destination_service, config->service_config_id,
config_pb.DebugString());
MessageUtil::getJsonStringFromMessage(config_pb, true));
}

FilterHeadersStatus Filter::decodeHeaders(HeaderMap& headers, bool) {
Expand Down
2 changes: 1 addition & 1 deletion src/envoy/utils/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool ReadConfig(const Json::Object &json, const std::string &config_version,
auto &logger = Logger::Registry::getLog(Logger::Id::config);
if (status.ok()) {
ENVOY_LOG_TO_LOGGER(logger, info, "{} mixer client config: {}",
config_version, message->DebugString());
config_version, config_str);
return true;
}
ENVOY_LOG_TO_LOGGER(
Expand Down

0 comments on commit 5317cae

Please sign in to comment.