Topics

回复: Re: [Edgex-golang] How can I control the ouput of logs based on log level

sunjj@mingdutech.com
 

Hi Jim,
Thank you for your answer.  sorry I didn't describe the question clearly yesterday.

I am using the Go service of core data.  Is there a configuration in  cmd/core-data/res/configuration.toml  just as java's application.yml(logging.level.org.edgexfoundry=INFO)。

Thank you!
Jianjiao



孙建蛟 -- 研发部  IOT
************************************************************
浙江明度智控科技有限公司
公司地址:浙江省杭州市滨江区江虹南路316号京安创业园
工厂地址:江苏省昆山市汉浦路1937号欣昆产业园
电 话:0571-88196008   传 真:0571-86718570
邮 箱:sunjj@mingdutech.com

 
发件人: James.White2
发送时间: 2018-08-07 23:32
抄送: Akram.Ahmad@...
主题: Re: [Edgex-golang] How can I control the ouput of logs based on log level

Jianjiano,

 

Courtesy of Akram Ahmad from my team, the following should help:

 

Assuming you are working with the new Go services.  In the Go services you can set the log level in each service call with this function

func (lc EdgeXLogger) log(logLevel string, msg string, labels []string) error {

}

 

To set the level more universally for that service, set the following config option:

/config/application/logging.level.root :  This specifies the level of logging mechanism, the value is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, and OFF.

 

Similar options and capability are also in the older Java services if you need it.

 

See https://nexus.edgexfoundry.org/content/sites/docs/staging/master/docs/_build/html/Ch-Logging.html for more info on the logging service.

 

Hope this helps.

Jim

 

From: EdgeX-GoLang@... [mailto:EdgeX-GoLang@...] On Behalf Of sunjj@...
Sent: Monday, August 06, 2018 9:52 PM
To: EdgeX-GoLang
Subject: [Edgex-golang] How can I control the ouput of logs based on log level

 

Hi,

    How can I control the ouput of logs based on log level 

Thanks,

jianjiao

 


孙建蛟 -- 研发部  IOT

************************************************************

浙江明度智控科技有限公司

公司地址:浙江省杭州市滨江区江虹南路316号京安创业园

工厂地址:江苏省昆山市汉浦路1937号欣昆产业园

话:0571-88196008   真:0571-86718570

箱:sunjj@mingdutech.com