Suresh
Suresh

Reputation: 21

Feasibility of Dynamically setting Environment Variables in Hyperledger Fabric

Can we dynamically change the Hyperledger environment variables that we are setting before setting up the HyperLedger components during the run time. For instance, if we need to change the FABRIC_LOGGING_SPEC from debug to info during the Orderer or PEER runtime with or without docker image, is it possible?

Upvotes: 0

Views: 140

Answers (2)

Braj
Braj

Reputation: 626

I was trying to achieve the same in past once. But found out after you create a docker container using the service mentioned in yaml file, one can't modify the env parameters. Using 'export' you can change it but only as long as you are bashed in that container. Once you bash out of that container, the old default value will set in. One solution to it can be, spin a new container with desired env parameters. And port all the data from old container to new container. Also required updates to config blocks of the channel.

Upvotes: 0

Yadhukrishna
Yadhukrishna

Reputation: 842

Yes, The peer logging can dynamically changed using the cli docker access. There are certain helpful commands that will guide you the usage like

  • To get the log level for logger peer: peer logging getlevel peer

  • To get the active logging spec for the peer: peer logging getlogspec

  • To set the log level for loggers matching logger name prefix gossip to log level INFO: peer logging setlevel gossip info

  • To revert the logging spec to the start-up value: peer logging revertlevels

Get a more detailed explanation and usage on docs.

Upvotes: 1

Related Questions