File tree Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -278,23 +278,23 @@ func InitCmd(cmd *cobra.Command, args []string) {
278
278
os .Exit (1 )
279
279
}
280
280
281
- // check for --logging-level pflag first, which should override all other
282
- // log settings. if --logging-level is not set, use CORE_LOGGING_LEVEL
283
- // (environment variable takes priority; otherwise, the value set in
284
- // core.yaml)
281
+ // read in the legacy logging level settings and, if set,
282
+ // notify users of the FABRIC_LOGGING_SPEC env variable
285
283
var loggingLevel string
286
284
if viper .GetString ("logging_level" ) != "" {
287
285
loggingLevel = viper .GetString ("logging_level" )
288
286
} else {
289
287
loggingLevel = viper .GetString ("logging.level" )
290
288
}
291
- loggingSpec := os .Getenv ("FABRIC_LOGGING_SPEC" )
292
289
if loggingLevel != "" {
293
- mainLogger .Warning ("CORE_LOGGING_LEVEL is no longer supported, please use FABRIC_LOGGING_SPEC environment variable. " )
290
+ mainLogger .Warning ("CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable" )
294
291
}
295
292
293
+ loggingSpec := os .Getenv ("FABRIC_LOGGING_SPEC" )
294
+ loggingFormat := os .Getenv ("FABRIC_LOGGING_FORMAT" )
295
+
296
296
flogging .Init (flogging.Config {
297
- Format : viper . GetString ( "logging.format" ) ,
297
+ Format : loggingFormat ,
298
298
Writer : logOutput ,
299
299
LogSpec : loggingSpec ,
300
300
})
Original file line number Diff line number Diff line change 3
3
# SPDX-License-Identifier: Apache-2.0
4
4
#
5
5
6
- # ##############################################################################
7
- #
8
- # LOGGING section
9
- #
10
- # ##############################################################################
11
- logging :
12
-
13
- # Message format for the peer logs
14
- format : ' %{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}'
15
-
16
6
# ##############################################################################
17
7
#
18
8
# Peer section
You can’t perform that action at this time.
0 commit comments