diff --git a/src/server/main_service.cc b/src/server/main_service.cc index 5ff280a51..821032e74 100644 --- a/src/server/main_service.cc +++ b/src/server/main_service.cc @@ -37,7 +37,7 @@ extern "C" { // TODO: to move to absl flags and keep legacy flags only for glog library. // absl flags allow parsing of custom types and allow specifying which flags appear // for helpshort. -DEFINE_uint32(port, 6380, "Redis port"); +DEFINE_uint32(port, 6379, "Redis port"); DEFINE_uint32(memcache_port, 0, "Memcached port"); DECLARE_string(requirepass); DEFINE_uint64(maxmemory, 0, "Limit on maximum-memory that is used by the database"); @@ -997,18 +997,20 @@ void Service::RegisterCommands() { server_family_.Register(®istry_); - LOG(INFO) << "Multi-key commands are: "; - registry_.Traverse([](std::string_view key, const CI& cid) { - if (cid.is_multi_key()) { - string key_len; - if (cid.last_key_pos() < 0) - key_len = "unlimited"; - else - key_len = absl::StrCat(cid.last_key_pos() - cid.first_key_pos() + 1); - LOG(INFO) << " " << key << ": with " << key_len << " keys"; - } - }); + if (VLOG_IS_ON(1)) { + LOG(INFO) << "Multi-key commands are: "; + registry_.Traverse([](std::string_view key, const CI& cid) { + if (cid.is_multi_key()) { + string key_len; + if (cid.last_key_pos() < 0) + key_len = "unlimited"; + else + key_len = absl::StrCat(cid.last_key_pos() - cid.first_key_pos() + 1); + LOG(INFO) << " " << key << ": with " << key_len << " keys"; + } + }); + } } } // namespace dfly diff --git a/src/server/server_family.cc b/src/server/server_family.cc index 0003e4c60..cf3fe8c9e 100644 --- a/src/server/server_family.cc +++ b/src/server/server_family.cc @@ -103,6 +103,18 @@ void ServerFamily::Init(util::AcceptServer* acceptor) { }; task_10ms_ = pb_task_->AwaitBrief([&] { return pb_task_->AddPeriodic(10, cache_cb); }); + + fs::path data_path = fs::current_path(); + + if (!FLAGS_dir.empty()) { + data_path = FLAGS_dir; + + error_code ec; + + data_path = fs::canonical(data_path, ec); + } + + LOG(INFO) << "Data directory is " << data_path; } void ServerFamily::Shutdown() { diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh index 2d1546ff6..660e46ec5 100755 --- a/tools/docker/entrypoint.sh +++ b/tools/docker/entrypoint.sh @@ -2,9 +2,10 @@ set -e -# first arg is `--some-option` +# first arg is `-some-option` if [ "${1#-}" != "$1" ]; then - set -- dragonfly "$@" + # override arguments by prepending "dragonfly --logtostderr" to them. + set -- dragonfly --logtostderr "$@" fi # allow the docker container to be started with `--user`