Skip to content

Commit

Permalink
logs: removing a hard linkage on file based access logs (envoyproxy#…
Browse files Browse the repository at this point in the history
…32882)

logs: removing a hard linkage on file based access logs

Signed-off-by: Alyssa Wilk <[email protected]>
  • Loading branch information
alyssawilk authored Mar 15, 2024
1 parent 8b293ba commit 49e8a59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/mobile-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
source/server/guarddog_impl.h
source/server/watchdog_impl.h
source/server/options_impl.cc
source/extensions/access_loggers/common/file_access_log_impl.h
target: size-current
- name: Main size
args: >-
Expand Down
2 changes: 1 addition & 1 deletion source/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ envoy_cc_library(
"//source/common/network:socket_option_lib",
"//source/common/network:utility_lib",
"//source/common/protobuf:utility_lib",
"//source/extensions/access_loggers/common:file_access_log_lib",
"@envoy_api//envoy/config/bootstrap/v3:pkg_cc_proto",
"@envoy_api//envoy/config/metrics/v3:pkg_cc_proto",
"@envoy_api//envoy/config/trace/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/access_loggers/file/v3:pkg_cc_proto",
],
)

Expand Down
14 changes: 8 additions & 6 deletions source/server/configuration_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "envoy/config/bootstrap/v3/bootstrap.pb.h"
#include "envoy/config/metrics/v3/stats.pb.h"
#include "envoy/config/trace/v3/http_tracer.pb.h"
#include "envoy/extensions/access_loggers/file/v3/file.pb.h"
#include "envoy/network/connection.h"
#include "envoy/runtime/runtime.h"
#include "envoy/server/instance.h"
Expand All @@ -23,7 +24,6 @@
#include "source/common/config/utility.h"
#include "source/common/network/socket_option_factory.h"
#include "source/common/protobuf/utility.h"
#include "source/extensions/access_loggers/common/file_access_log_impl.h"

namespace Envoy {
namespace Server {
Expand Down Expand Up @@ -276,11 +276,13 @@ void InitialImpl::initAdminAccessLog(const envoy::config::bootstrap::v3::Bootstr
}

if (!admin.access_log_path().empty()) {
Filesystem::FilePathAndType file_info{Filesystem::DestinationType::File,
admin.access_log_path()};
admin_.access_logs_.emplace_back(new Extensions::AccessLoggers::File::FileAccessLog(
file_info, {}, Formatter::HttpSubstitutionFormatUtils::defaultSubstitutionFormatter(),
factory_context.serverFactoryContext().accessLogManager()));
envoy::extensions::access_loggers::file::v3::FileAccessLog config;
config.mutable_format();
config.set_path(admin.access_log_path());

auto factory = Config::Utility::getFactoryByName<AccessLog::AccessLogInstanceFactory>(
"envoy.file_access_log");
admin_.access_logs_.emplace_back(factory->createAccessLogInstance(config, {}, factory_context));
}
}

Expand Down

0 comments on commit 49e8a59

Please sign in to comment.