## 1. 释义
将日志记录器和日志等级添加到当前的日志规范中。
## 2. 使用方法
```
~$ peer logging setlevel <logger> <log level> [flags]
```
命令标志:
```
-h, --help help for setlevel
```
## 3. 示例代码
下面的示例将名称具有gossip前缀的日志记录器的日志等级设置为WARNING:
```
~$ peer logging setlevel gossip warning
2018-11-01 14:21:55.509 UTC [cli.logging] setLevel -> INFO 001 Log level set for logger name/prefix 'gossip': WARNING
```
如果要精确地指定一个名称,可以添加点后缀。例如下面的示例设置名为gossip的日志记录器等级为ERROR:
~~~
~$ peer logging setlevel gossip. error
2018-11-01 14:27:33.080 UTC [cli.logging] setLevel -> INFO 001 Log level set for logger name/prefix 'gossip
~~~
- Fabric命令手册
- Peer命令
- peer
- peer node
- peer node start
- peer node status
- peer channel
- peer channel create
- peer channel fetch
- peer channel getinfo
- peer channel join
- peer channel list
- peer channel signconfigtx
- peer channel update
- peer chaincode
- peer chaincode install
- peer chaincode instantiate
- peer chaincode invoke
- peer chaincode list
- peer chaincode package
- peer chaincode query
- peer chaincode signpackage
- peer chaincode upgrade
- peer version
- peer logging
- peer logging getlevel
- peer logging revertlevels
- peer logging setlevel
- Configtxgen命令
- configtxgen
- Configtxlator命令
- configtxlator
- configtxlator start
- configtxlator proto_encode
- configtxlator proto_decode
- configtxlator compute_update
- configtxlator version
- Cryptogen命令
- cryptogen
- cryptogen help
- cryptogen generate
- cryptogen showtemplate
- FabricCA命令
- fabric-ca-client
- fabric-ca-server