Configuration
The default configuration of peer logging is set to the level INFO, but this level can be controlled in the following ways:
- A command line option logging level. This option overrides default configurations, shown as follows:
peer node start --logging-level=error
Note that any module or chaincode can be configured through the command line option, as shown in the following snippet:
peer node start --logging-level=chaincode=error:main=info
- The default logging level can also be defined with an environment variable CORE_LOGGING_LEVEL, as shown in the following snippet:
peer0.org1.example.com:
environment:
- CORE_LOGGING_LEVEL=error
- A configuration attribute in the core.yml file, defining the configuration of a network can also be used with the following code:
logging:
level: info
- The core.yml file also allows you to configure logging levels for specific modules, such as for the chaincode or the format of messages, as shown in the following snippet:
chaincode: logging: level: error shim: warning
More detail on the various configuration options are provided in the comments of the core.yml file.