Skip to content

Commit

Permalink
Address CR comments for FAB-17000
Browse files Browse the repository at this point in the history
This change set allocates a designated logger
for the certificate expiration tracking, for
easier log capturing.

Change-Id: I83443f10f7a34153246a66fd8069f69ad01b43fe
Signed-off-by: yacovm <[email protected]>
  • Loading branch information
yacovm committed Nov 8, 2019
1 parent d7c5830 commit 649d563
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/peer/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ func serve(args []string) error {
logger.Panicf("Failed to serialize the signing identity: %v", err)
}

// Log warnings if some certificate (e-cert, TLS certs) expires soon
expirationLogger := flogging.MustGetLogger("certmonitor")
crypto.TrackExpiration(
serverConfig.SecOpts.UseTLS,
serverConfig.SecOpts.Certificate,
cs.GetClientCertificate().Certificate,
signingIdentityBytes,
logger.Warnf, // This can be used to piggyback a metric event in the future
expirationLogger.Warnf, // This can be used to piggyback a metric event in the future
time.Now(),
time.AfterFunc)

Expand Down
3 changes: 2 additions & 1 deletion orderer/common/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ func Main() {
logger.Panicf("Failed serializing signing identity: %v", err)
}

expirationLogger := flogging.MustGetLogger("certmonitor")
crypto.TrackExpiration(
serverConfig.SecOpts.UseTLS,
serverConfig.SecOpts.Certificate,
[][]byte{clusterClientConfig.SecOpts.Certificate},
identityBytes,
logger.Warnf, // This can be used to piggyback a metric event in the future
expirationLogger.Warnf, // This can be used to piggyback a metric event in the future
time.Now(),
time.AfterFunc)

Expand Down

0 comments on commit 649d563

Please sign in to comment.