From: Cory Snyder Date: Wed, 22 Sep 2021 14:14:12 +0000 (-0400) Subject: rgw: add abstraction for ops log destination and add file logger X-Git-Tag: v16.2.7~63^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1c809a5078d36c0f0590011d947c2b8b392dd07b;p=ceph.git rgw: add abstraction for ops log destination and add file logger Adds an OpsLogSink abstraction for ops log destinations. Also implements this abstraction for a file logger since it's easier to use files vs. sockets with containers. Fixes: https://tracker.ceph.com/issues/48752 Signed-off-by: Cory Snyder (cherry picked from commit c4c9f391aaa6983cf4ce0af144b70ecd27e76f45) Conflicts: src/common/options/rgw.yaml.in src/rgw/librgw.cc src/rgw/rgw_log.cc src/rgw/rgw_log.h src/rgw/rgw_lua_request.cc src/rgw/rgw_process.cc Cherry-pick notes: - Conflict due to change in configuration option specification between Pacific and master - Conflicts due to renaming RGWRados to rgw::sal::Store - Conflicts due to whitespace changes --- diff --git a/doc/radosgw/config-ref.rst b/doc/radosgw/config-ref.rst index e9d419fd3c06..1ed6085a6c76 100644 --- a/doc/radosgw/config-ref.rst +++ b/doc/radosgw/config-ref.rst @@ -804,6 +804,13 @@ Logging Settings :Default: None +``rgw_ops_log_file_path`` + +:Description: The file for writing operations logs. +:Type: String +:Default: None + + ``rgw_ops_log_data_backlog`` :Description: The maximum data backlog data size for operations logs written diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index f2610f33a709..fc94fc112b04 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1405,6 +1405,7 @@ OPTION(rgw_usage_max_user_shards, OPT_INT) OPTION(rgw_enable_ops_log, OPT_BOOL) // enable logging every rgw operation OPTION(rgw_enable_usage_log, OPT_BOOL) // enable logging bandwidth usage OPTION(rgw_ops_log_rados, OPT_BOOL) // whether ops log should go to rados +OPTION(rgw_ops_log_file_path, OPT_STR) // path to file where ops log can go OPTION(rgw_ops_log_socket_path, OPT_STR) // path to unix domain socket where ops log can go OPTION(rgw_ops_log_data_backlog, OPT_INT) // max data backlog for ops log OPTION(rgw_fcgi_socket_backlog, OPT_INT) // socket backlog for fcgi diff --git a/src/common/options.cc b/src/common/options.cc index 1a13982179ee..1b2975a3c6ea 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -6509,6 +6509,12 @@ std::vector