diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2020-02-26 09:16:52 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-28 15:07:03 +0000 |
commit | 9f1853349108cca23a7b012841cfd73b14be9b63 (patch) | |
tree | 276de0e20b62973a34b1e712fef7d2b95d17cb57 | |
parent | 6162bd9a335ebf8c87e1af657439d02d48bbc809 (diff) | |
download | mongo-9f1853349108cca23a7b012841cfd73b14be9b63.tar.gz |
SERVER-46415 Remove logFormat option and the ability to select the text formatter
-rw-r--r-- | buildscripts/resmokelib/config.py | 5 | ||||
-rw-r--r-- | buildscripts/resmokelib/core/programs.py | 8 | ||||
-rw-r--r-- | buildscripts/resmokelib/parser.py | 4 | ||||
-rw-r--r-- | etc/evergreen.yml | 94 | ||||
-rw-r--r-- | jstests/libs/logv2_helpers.js | 26 | ||||
-rw-r--r-- | jstests/noPassthrough/command_line_parsing.js | 2 | ||||
-rw-r--r-- | src/mongo/db/initialize_server_global_state.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/server_options.h | 1 | ||||
-rw-r--r-- | src/mongo/db/server_options_base.idl | 9 | ||||
-rw-r--r-- | src/mongo/db/server_options_helpers.cpp | 22 | ||||
-rw-r--r-- | src/mongo/logv2/attribute_storage.h | 8 | ||||
-rw-r--r-- | src/mongo/logv2/log_domain_global.cpp | 9 | ||||
-rw-r--r-- | src/mongo/logv2/log_format.h | 2 | ||||
-rw-r--r-- | src/mongo/shell/dbshell.cpp | 19 | ||||
-rw-r--r-- | src/mongo/shell/servers.js | 9 | ||||
-rw-r--r-- | src/mongo/shell/shell_options.cpp | 21 | ||||
-rw-r--r-- | src/mongo/shell/shell_options.h | 3 | ||||
-rw-r--r-- | src/mongo/shell/shell_options.idl | 6 | ||||
-rw-r--r-- | src/mongo/shell/utils.js | 1 | ||||
-rw-r--r-- | src/mongo/util/log.cpp | 18 | ||||
-rw-r--r-- | src/mongo/util/log_global_settings.h | 1 |
21 files changed, 14 insertions, 255 deletions
diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py index 0c3a047e1eb..eece4d62ea6 100644 --- a/buildscripts/resmokelib/config.py +++ b/buildscripts/resmokelib/config.py @@ -63,7 +63,6 @@ DEFAULTS = { "include_with_any_tags": None, "install_dir": None, "jobs": 1, - "log_format": None, "mongo_executable": None, "mongod_executable": None, "mongod_set_parameters": None, @@ -321,10 +320,6 @@ MONGOD_EXECUTABLE = None # The --setParameter options passed to mongod. MONGOD_SET_PARAMETERS = None -# If set, the log format to use by all mongod's and mongo shells started by resmoke.py -# Supported values are the same as what is supported in mongod/mongo shell: default, text, json -LOG_FORMAT = None - # The path to the mongos executable used by resmoke.py. MONGOS_EXECUTABLE = None diff --git a/buildscripts/resmokelib/core/programs.py b/buildscripts/resmokelib/core/programs.py index db5e893f194..35493b4feff 100644 --- a/buildscripts/resmokelib/core/programs.py +++ b/buildscripts/resmokelib/core/programs.py @@ -149,7 +149,6 @@ def mongod_program( # pylint: disable=too-many-branches shortcut_opts = { "enableMajorityReadConcern": config.MAJORITY_READ_CONCERN, - "logFormat": config.LOG_FORMAT, "nojournal": config.NO_JOURNAL, "serviceExecutor": config.SERVICE_EXECUTOR, "storageEngine": config.STORAGE_ENGINE, @@ -225,9 +224,6 @@ def mongos_program(logger, executable=None, process_kwargs=None, **kwargs): _apply_set_parameters(args, suite_set_parameters) - if config.LOG_FORMAT is not None: - kwargs["logFormat"] = config.LOG_FORMAT - # Apply the rest of the command line arguments. _apply_kwargs(args, kwargs) @@ -258,7 +254,6 @@ def mongo_shell_program( # pylint: disable=too-many-branches,too-many-locals,to test_name = None shortcut_opts = { "enableMajorityReadConcern": (config.MAJORITY_READ_CONCERN, True), - "logFormat": (config.LOG_FORMAT, ""), "mixedBinVersions": (config.MIXED_BIN_VERSIONS, ""), "noJournal": (config.NO_JOURNAL, False), "serviceExecutor": (config.SERVICE_EXECUTOR, ""), @@ -382,9 +377,6 @@ def mongo_shell_program( # pylint: disable=too-many-branches,too-many-locals,to if "host" in kwargs: kwargs.pop("host") - if config.LOG_FORMAT is not None: - kwargs["logFormat"] = config.LOG_FORMAT - # Apply the rest of the command line arguments. _apply_kwargs(args, kwargs) diff --git a/buildscripts/resmokelib/parser.py b/buildscripts/resmokelib/parser.py index a5f5dc88601..de98e1a80fe 100644 --- a/buildscripts/resmokelib/parser.py +++ b/buildscripts/resmokelib/parser.py @@ -143,9 +143,6 @@ def _make_parser(): # pylint: disable=too-many-statements " started by resmoke.py. The argument is specified as bracketed YAML -" " i.e. JSON with support for single quoted and unquoted keys.")) - parser.add_option("--logFormat", dest="log_format", - help="The log format used by mongo executables.") - parser.add_option("--mongos", dest="mongos_executable", metavar="PATH", help="The path to the mongos executable for resmoke.py to use.") @@ -619,7 +616,6 @@ def _update_config_vars(values): # pylint: disable=too-many-statements,too-many _config.GENNY_EXECUTABLE = _expand_user(config.pop("genny_executable")) _config.JOBS = config.pop("jobs") _config.LINEAR_CHAIN = config.pop("linear_chain") == "on" - _config.LOG_FORMAT = config.pop("log_format") _config.MAJORITY_READ_CONCERN = config.pop("majority_read_concern") == "on" _config.MIXED_BIN_VERSIONS = config.pop("mixed_bin_versions") if _config.MIXED_BIN_VERSIONS is not None: diff --git a/etc/evergreen.yml b/etc/evergreen.yml index 719822b0a39..7d2e9da2fa4 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -11566,100 +11566,6 @@ buildvariants: - name: .ssl - name: .updatefuzzer - # Builder with JSON log format, not needed when JSON is default format. See: - # https://jira.mongodb.org/browse/SERVER-45138 -- name: enterprise-rhel-62-64-bit-logv2-text - display_name: "~ Enterprise RHEL 6.2 (logv2 text)" - modules: - - enterprise - run_on: - - rhel62-large - batchtime: 1440 # 1 day - expansions: - additional_targets: archive-mongocryptd archive-mongocryptd-debug - mh_target: archive-mh archive-mh-debug - compile_flags: --ssl MONGO_DISTMOD=rhel62 -j$(grep -c ^processor /proc/cpuinfo) --variables-files=etc/scons/mongodbtoolchain_v3_gcc.vars CPPDEFINES=MONGO_CONFIG_TEXT_LOG_DEFAULT - multiversion_platform: rhel62 - multiversion_edition: enterprise - has_packages: true - packager_script: packager_enterprise.py - packager_arch: x86_64 - packager_distro: rhel62 - repo_edition: enterprise - scons_cache_scope: shared - jstestfuzz_num_generated_files: 40 - jstestfuzz_concurrent_num_files: 10 - target_resmoke_time: 10 - large_distro_name: rhel62-large - burn_in_tag_buildvariants: enterprise-rhel-62-64-bit-majority-read-concern-off enterprise-rhel-62-64-bit-inmem linux-64-duroff - tasks: - - name: compile_all_run_unittests_TG - distros: - - rhel62-large - - name: burn_in_tests_gen - - name: burn_in_tests_multiversion_gen - - name: .aggfuzzer - - name: .aggregation - - name: audit - - name: .auth - - name: burn_in_tags_gen - distros: - - centos6-perf - - name: buildscripts_test - - name: .causally_consistent !.sharding - - name: .change_streams - - name: .misc_js - - name: .concurrency !.large !.ubsan !.no_txns !.debug_only - - name: .concurrency .large !.ubsan !.no_txns !.debug_only - distros: - - rhel62-large - - name: disk_wiredtiger - - name: .encrypt - - name: idl_tests - - name: initial_sync_fuzzer_gen - - name: .integration - distros: - - rhel62-large - - name: .jscore .common - - name: jsCore_minimum_batch_size - - name: jsCore_op_query - - name: jsCore_txns_large_txns_format - - name: jsonSchema - - name: .jstestfuzz - - name: .logical_session_cache - - name: .multi_shard - - name: multi_stmt_txn_jscore_passthrough_with_migration_gen - - name: multiversion_gen - - name: .query_fuzzer - - name: .read_write_concern .large - distros: - - rhel62-large - - name: .read_write_concern !.large - - name: .replica_sets !.encrypt !.auth - distros: - - rhel62-large - - name: retryable_writes_jscore_passthrough_gen - - name: retryable_writes_jscore_stepdown_passthrough - distros: - - rhel62-large - - name: .read_only - - name: .rollbackfuzzer - - name: sasl - - name: search - - name: search_auth - - name: search_ssl - - name: session_jscore_passthrough - - name: .sharding .jscore !.wo_snapshot !.multi_stmt - - name: .sharding .txns - - name: .sharding .common - - name: sharded_multi_stmt_txn_jscore_passthrough - distros: - - rhel62-large - - name: snmp - - name: .stitch - - name: .updatefuzzer - - name: secondary_reads_passthrough_gen - - name: linux-64-ephemeralForTest display_name: Linux (ephemeralForTest) run_on: diff --git a/jstests/libs/logv2_helpers.js b/jstests/libs/logv2_helpers.js index d9ce60dd519..36cfecfaade 100644 --- a/jstests/libs/logv2_helpers.js +++ b/jstests/libs/logv2_helpers.js @@ -1,36 +1,14 @@ // logv2_helper.js function isJsonLogNoConn() { - const textDefault = - getBuildInfo().buildEnvironment.cppdefines.indexOf("MONGO_CONFIG_TEXT_LOG_DEFAULT") >= 0; - if (typeof TestData !== 'undefined' && typeof TestData.logFormat !== 'undefined' && - TestData["logFormat"] != "") { - return TestData["logFormat"] != "text" || (textDefault && TestData["logFormat"] == "json"); - } - - return !textDefault; + return true; } function isJsonLog(conn) { - const textDefault = - getBuildInfo().buildEnvironment.cppdefines.indexOf("MONGO_CONFIG_TEXT_LOG_DEFAULT") >= 0; - if (typeof TestData !== 'undefined' && typeof TestData.logFormat !== 'undefined' && - TestData["logFormat"] != "") { - return TestData["logFormat"] != "text" || (textDefault && TestData["logFormat"] == "json"); - } - - const opts = assert.commandWorked(conn.getDB("admin").runCommand({"getCmdLineOpts": 1})); - const parsed = opts["parsed"]; - if (parsed.hasOwnProperty("systemLog") && parsed["systemLog"].hasOwnProperty("logFormat") && - parsed["systemLog"]["logFormat"] != "") { - return parsed["systemLog"]["logFormat"] != "text" || - (textDefault && parsed["systemLog"]["logFormat"] == "json"); - } - const buildInfo = assert.commandWorked(conn.getDB("admin").runCommand({"buildinfo": 1})); if (buildInfo.version.length >= 3 && buildInfo.version.substring(0, 3) == "4.2") { return false; } - return !textDefault; + return true; } diff --git a/jstests/noPassthrough/command_line_parsing.js b/jstests/noPassthrough/command_line_parsing.js index ea3beb7002f..9e96dcab01a 100644 --- a/jstests/noPassthrough/command_line_parsing.js +++ b/jstests/noPassthrough/command_line_parsing.js @@ -36,7 +36,6 @@ delete m2result.parsed.storage.inMemory; delete m2result.parsed.storage.journal; delete m2result.parsed.storage.rocksdb; delete m2result.parsed.storage.wiredTiger; -delete m2result.parsed.systemLog; delete m2result.parsed.replication; // Removes enableMajorityReadConcern setting. assert.docEq(m2expected.parsed, m2result.parsed); @@ -66,6 +65,5 @@ delete m3result.parsed.storage.inMemory; delete m3result.parsed.storage.journal; delete m3result.parsed.storage.rocksdb; delete m3result.parsed.storage.wiredTiger; -delete m3result.parsed.systemLog; delete m3result.parsed.replication; // Removes enableMajorityReadConcern setting. assert.docEq(m3expected.parsed, m3result.parsed); diff --git a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp index b7f7a3f854c..22e35f3a753 100644 --- a/src/mongo/db/initialize_server_global_state.cpp +++ b/src/mongo/db/initialize_server_global_state.cpp @@ -374,7 +374,6 @@ MONGO_INITIALIZER_GENERAL(ServerLogRedirection, if (logV2Enabled()) { - lv2Config.format = serverGlobalParams.logFormat; lv2Config.timestampFormat = serverGlobalParams.logTimestampFormat; Status result = lv2Manager.getGlobalDomainInternal().configure(lv2Config); if (result.isOK() && writeServerRestartedAfterLogConfig) diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h index fd35dec3769..ac1b6e3c1d8 100644 --- a/src/mongo/db/server_options.h +++ b/src/mongo/db/server_options.h @@ -96,7 +96,6 @@ struct ServerGlobalParams { std::string timeZoneInfoPath; // Path to time zone info directory, or empty if none. std::string logpath; // Path to log file, if logging to a file; otherwise, empty. - logv2::LogFormat logFormat = logv2::LogFormat::kDefault; // Log format to output to logv2::LogTimestampFormat logTimestampFormat = logv2::LogTimestampFormat::kISO8601Local; bool logAppend = false; // True if logging to a file in append mode. diff --git a/src/mongo/db/server_options_base.idl b/src/mongo/db/server_options_base.idl index fcf7a88047f..7cfc525dbdd 100644 --- a/src/mongo/db/server_options_base.idl +++ b/src/mongo/db/server_options_base.idl @@ -109,10 +109,6 @@ configs: validator: callback: validateSystemLogDestinationSetting - logv2: - description: "logging gets directed to the logv2 backend" - arg_vartype: Switch - source: [ cli, ini ] syslog: description: "Log to system's syslog facility instead of file or stdout" arg_vartype: Switch @@ -126,11 +122,6 @@ configs: arg_vartype: String condition: preprocessor: '!defined(_WIN32)' - 'systemLog.logFormat': - description: 'Set the log output format (default|text|json)' - short_name: logFormat - arg_vartype: String - default: "default" 'systemLog.logAppend': description: 'Append to logpath instead of over-writing' short_name: logappend diff --git a/src/mongo/db/server_options_helpers.cpp b/src/mongo/db/server_options_helpers.cpp index ba592b4eaa6..163cb6ce737 100644 --- a/src/mongo/db/server_options_helpers.cpp +++ b/src/mongo/db/server_options_helpers.cpp @@ -263,10 +263,6 @@ Status storeBaseOptions(const moe::Environment& params) { return ret; } - if (params.count("logv2")) { - logV2Set(true); - } - if (params.count("systemLog.verbosity")) { int verbosity = params["systemLog.verbosity"].as<int>(); if (verbosity < 0) { @@ -382,24 +378,6 @@ Status storeBaseOptions(const moe::Environment& params) { } #endif // _WIN32 - if (params.count("systemLog.logFormat")) { - std::string formatStr = params["systemLog.logFormat"].as<string>(); - if (!logV2Enabled() && formatStr != "default") - return Status(ErrorCodes::BadValue, - "Can only use systemLog.logFormat if logv2 is enabled."); - if (formatStr == "default") { - serverGlobalParams.logFormat = logv2::LogFormat::kDefault; - } else if (formatStr == "text") { - serverGlobalParams.logFormat = logv2::LogFormat::kText; - } else if (formatStr == "json") { - serverGlobalParams.logFormat = logv2::LogFormat::kJson; - } else { - return Status(ErrorCodes::BadValue, - "Unsupported value for logFormat: " + formatStr + - ". Valid values are: default, text or json"); - } - } - if (params.count("systemLog.logAppend") && params["systemLog.logAppend"].as<bool>() == true) { serverGlobalParams.logAppend = true; } diff --git a/src/mongo/logv2/attribute_storage.h b/src/mongo/logv2/attribute_storage.h index 8dc1228d864..2514c0404a7 100644 --- a/src/mongo/logv2/attribute_storage.h +++ b/src/mongo/logv2/attribute_storage.h @@ -287,8 +287,12 @@ template < CustomAttributeValue mapValue(const T& val) { static_assert(HasToString<T>::value || HasToStringReturnStringData<T>::value || HasStringSerialize<T>::value || HasNonMemberToString<T>::value || - HasNonMemberToStringReturnStringData<T>::value, - "custom type needs toString() or serialize(fmt::memory_buffer&) implementation"); + HasNonMemberToStringReturnStringData<T>::value || + HasBSONBuilderAppend<T>::value || HasBSONSerialize<T>::value || + HasToBSON<T>::value || HasToBSONArray<T>::value || + HasNonMemberToBSON<T>::value, + "custom type needs toBSON(), toBSONArray(), serialize(BSONObjBuilder*), " + "toString() or serialize(fmt::memory_buffer&) implementation"); CustomAttributeValue custom; if constexpr (HasBSONBuilderAppend<T>::value) { diff --git a/src/mongo/logv2/log_domain_global.cpp b/src/mongo/logv2/log_domain_global.cpp index 000ed72ffe3..327c046da42 100644 --- a/src/mongo/logv2/log_domain_global.cpp +++ b/src/mongo/logv2/log_domain_global.cpp @@ -187,19 +187,10 @@ Status LogDomainGlobal::Impl::configure(LogDomainGlobal::ConfigurationOptions co }; switch (options.format) { -#if defined(MONGO_CONFIG_TEXT_LOG_DEFAULT) - case LogFormat::kDefault: -#endif - case LogFormat::kText: - setFormatters( - [&] { return TextFormatter(options.maxAttributeSizeKB, options.timestampFormat); }); - break; case LogFormat::kPlain: setFormatters([&] { return PlainFormatter(options.maxAttributeSizeKB); }); break; -#if !defined(MONGO_CONFIG_TEXT_LOG_DEFAULT) case LogFormat::kDefault: -#endif case LogFormat::kJson: setFormatters( [&] { return JSONFormatter(options.maxAttributeSizeKB, options.timestampFormat); }); diff --git a/src/mongo/logv2/log_format.h b/src/mongo/logv2/log_format.h index b1a57287d96..b95a5c297b2 100644 --- a/src/mongo/logv2/log_format.h +++ b/src/mongo/logv2/log_format.h @@ -31,7 +31,7 @@ namespace mongo { namespace logv2 { -enum class LogFormat { kDefault, kText, kJson, kPlain }; +enum class LogFormat { kDefault, kJson, kPlain }; enum class LogTimestampFormat { kISO8601UTC, kISO8601Local }; } // namespace logv2 } // namespace mongo diff --git a/src/mongo/shell/dbshell.cpp b/src/mongo/shell/dbshell.cpp index 89616e477f5..946e1e10782 100644 --- a/src/mongo/shell/dbshell.cpp +++ b/src/mongo/shell/dbshell.cpp @@ -195,9 +195,8 @@ public: /** * Formatter to provide specialized formatting for logs from javascript engine */ -class ShellFormatter final : private logv2::TextFormatter, private logv2::JSONFormatter { +class ShellFormatter final : private logv2::PlainFormatter, private logv2::JSONFormatter { public: - ShellFormatter(bool isJson) : _isJson(isJson) {} void operator()(boost::log::record_view const& rec, boost::log::formatting_ostream& strm) { using namespace logv2; using boost::log::extract; @@ -205,16 +204,9 @@ public: if (extract<LogTag>(attributes::tags(), rec).get().has(LogTag::kPlainShell)) { PlainFormatter::operator()(rec, strm); } else { - if (_isJson) { - JSONFormatter::operator()(rec, strm); - } else { - TextFormatter::operator()(rec, strm); - } + JSONFormatter::operator()(rec, strm); } } - -private: - bool _isJson; }; } // namespace @@ -792,12 +784,7 @@ int _main(int argc, char* argv[], char** envp) { auto consoleSink = boost::make_shared<boost::log::sinks::synchronous_sink<ShellBackend>>(); consoleSink->set_filter(logv2::ComponentSettingsFilter(lv2Manager.getGlobalDomain(), lv2Manager.getGlobalSettings())); -#if defined(MONGO_CONFIG_TEXT_LOG_DEFAULT) - bool isJson = shellGlobalParams.logFormat == logv2::LogFormat::kJson; -#else - bool isJson = shellGlobalParams.logFormat != logv2::LogFormat::kText; -#endif - consoleSink->set_formatter(ShellFormatter(isJson)); + consoleSink->set_formatter(ShellFormatter()); consoleSink->locked_backend()->add_stream( boost::shared_ptr<std::ostream>(&logv2::Console::out(), boost::null_deleter())); diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js index ce54eb458ce..22ca5e87df3 100644 --- a/src/mongo/shell/servers.js +++ b/src/mongo/shell/servers.js @@ -1129,15 +1129,6 @@ function appendSetParameterArgs(argArray) { argArray.push(...['--setParameter', "disableLogicalSessionCacheRefresh=true"]); } - // New options in 4.3.x - if (!programMajorMinorVersion || programMajorMinorVersion >= 403) { - if (jsTest.options().logFormat) { - if (!argArrayContains("--logFormat")) { - argArray.push(...["--logFormat", jsTest.options().logFormat]); - } - } - } - // Since options may not be backward compatible, mongos options are not // set on older versions, e.g., mongos-3.0. if (programName.endsWith('mongos')) { diff --git a/src/mongo/shell/shell_options.cpp b/src/mongo/shell/shell_options.cpp index eda52f5a155..8ce8dc6e2ad 100644 --- a/src/mongo/shell/shell_options.cpp +++ b/src/mongo/shell/shell_options.cpp @@ -341,27 +341,6 @@ Status storeMongoShellOptions(const moe::Environment& params, } } - if (params.count("logv2")) { - logV2Set(true); - } - - if (params.count("logFormat")) { - std::string formatStr = params["logFormat"].as<string>(); - if (!logV2Enabled() && formatStr != "default") - return Status(ErrorCodes::BadValue, "Can only use logFormat if logv2 is enabled."); - if (formatStr == "default") { - shellGlobalParams.logFormat = logv2::LogFormat::kDefault; - } else if (formatStr == "text") { - shellGlobalParams.logFormat = logv2::LogFormat::kText; - } else if (formatStr == "json") { - shellGlobalParams.logFormat = logv2::LogFormat::kJson; - } else { - return Status(ErrorCodes::BadValue, - "Unsupported value for logFormat: " + formatStr + - ". Valid values are: default, text or json"); - } - } - return Status::OK(); } diff --git a/src/mongo/shell/shell_options.h b/src/mongo/shell/shell_options.h index 9f70f57143f..45ac4e55455 100644 --- a/src/mongo/shell/shell_options.h +++ b/src/mongo/shell/shell_options.h @@ -34,7 +34,6 @@ #include <vector> #include "mongo/base/status.h" -#include "mongo/logv2/log_format.h" #include "mongo/rpc/protocol.h" namespace mongo { @@ -82,8 +81,6 @@ struct ShellGlobalParams { int jsHeapLimitMB = 0; bool nokillop = false; Seconds idleSessionTimeout = Seconds{0}; - - logv2::LogFormat logFormat = logv2::LogFormat::kDefault; // Log format to output to }; extern ShellGlobalParams shellGlobalParams; diff --git a/src/mongo/shell/shell_options.idl b/src/mongo/shell/shell_options.idl index 218a966b833..c56a951b2ee 100644 --- a/src/mongo/shell/shell_options.idl +++ b/src/mongo/shell/shell_options.idl @@ -213,9 +213,3 @@ configs: description: "logging gets directed to the logv2 backend" arg_vartype: Switch source: [ cli, ini ] - - "logFormat": - description: 'Set the log output format (default|text|json)' - short_name: logFormat - arg_vartype: String - default: "default" diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js index f1472995fc0..dcfface166e 100644 --- a/src/mongo/shell/utils.js +++ b/src/mongo/shell/utils.js @@ -279,7 +279,6 @@ jsTestOptions = function() { wiredTigerIndexConfigString: TestData.wiredTigerIndexConfigString, noJournal: TestData.noJournal, auth: TestData.auth, - logFormat: TestData.logFormat, // Note: keyFile is also used as a flag to indicate cluster auth is turned on, set it // to a truthy value if you'd like to do cluster auth, even if it's not keyFile auth. // Use clusterAuthMode to specify the actual auth mode you want to use. diff --git a/src/mongo/util/log.cpp b/src/mongo/util/log.cpp index ee72ac577a7..fdf9bd251ee 100644 --- a/src/mongo/util/log.cpp +++ b/src/mongo/util/log.cpp @@ -56,26 +56,12 @@ namespace mongo { -#if defined(MONGO_CONFIG_LOGV1_DEFAULT) -static bool _logV2Enabled = false; -#else -static bool _logV2Enabled = true; -#endif - bool logV2Enabled() { - return _logV2Enabled; + return true; } bool logV2IsJson(logv2::LogFormat format) { - return format == logv2::LogFormat::kJson -#if !defined(MONGO_CONFIG_TEXT_LOG_DEFAULT) - || format == logv2::LogFormat::kDefault -#endif - ; -} - -void logV2Set(bool setting) { - _logV2Enabled = setting; + return format == logv2::LogFormat::kJson || format == logv2::LogFormat::kDefault; } static logger::ExtraLogContextFn _appendExtraLogContext; diff --git a/src/mongo/util/log_global_settings.h b/src/mongo/util/log_global_settings.h index 3cf991a8882..9c8d149f7d7 100644 --- a/src/mongo/util/log_global_settings.h +++ b/src/mongo/util/log_global_settings.h @@ -43,7 +43,6 @@ namespace mongo { bool logV2Enabled(); bool logV2IsJson(logv2::LogFormat format); -void logV2Set(bool setting); /** * Runs the same logic as log()/warning()/error(), without actually outputting a stream. |