定義
db.getLogComponents()現在の冗長設定を返します。冗長設定は、MongoDBが各 ログメッセージコンポーネント に対して生成する MongoDBログメッセージ の量を決定します。
If a component inherits the verbosity level of its parent,
db.getLogComponents()displays-1for the component's verbosity.
互換性
このメソッドは、次の環境でホストされている配置で使用できます。
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
重要
This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
出力
The db.getLogComponents() returns a document with the verbosity settings. For example:
{ "verbosity" : 0, "accessControl" : { "verbosity" : -1 }, "command" : { "verbosity" : -1 }, "control" : { "verbosity" : -1 }, "geo" : { "verbosity" : -1 }, "index" : { "verbosity" : -1 }, "network" : { "verbosity" : -1 }, "query" : { "verbosity" : 2 }, "replication" : { "verbosity" : -1, "election" : { "verbosity" : -1 }, "heartbeats" : { "verbosity" : -1 }, "initialSync" : { "verbosity" : -1 }, "rollback" : { "verbosity" : -1 } }, "sharding" : { "verbosity" : -1 }, "storage" : { "verbosity" : 2, "recovery" : { "verbosity" : -1 }, "journal" : { "verbosity" : -1 } }, "write" : { "verbosity" : -1 } }
これらの設定を変更するには、systemLog.verbosity systemLog.component.<name>.verbosity構成ファイル で logComponentVerbosityと の設定を構成するか、 コマンドを使用して パラメーターを設定するか、setParameter db.setLogLevel()メソッドを使用します。例については、「ログ冗長レベルの構成 」を参照してください。