Topics

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

James.White2@...
 

Jianjiao,

You may have identified a shortcoming in our Go work.  We are discussing internally.  Give me a bit of time to work this within the community and get back to you.

Jim

 

From: sunjj@... [mailto:sunjj@...]
Sent: Wednesday, August 08, 2018 1:59 AM
To: White2, James; EdgeX-GoLang
Cc: Ahmad, Akram
Subject:
回复: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

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

收件人: sunjj@...; EdgeX-GoLang@...

抄送: 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

espy
 

On 8/9/18 2:27 PM, James.White2@... wrote:

Jianjiao,

You may have identified a shortcoming in our Go work.  We are discussing internally.  Give me a bit of time to work this within the community and get back to you.

Jim --

This is a known issue, and was last discussed when Trevor brought up his structured logging proposal.

If you'd like, I can enter a github issue, as the same bug impacts the Go device SDK.

By the way, here's a good article which describes the problem:

https://dave.cheney.net/2015/11/05/lets-talk-about-logging

Regards,
/tony

p.s. I'd also like to see our loggingClient support builtin printf style formatting like the Go log package. I'll add an issue for that as well.


Jim

 

From: sunjj@... [mailto:sunjj@...]
Sent: Wednesday, August 08, 2018 1:59 AM
To: White2, James; EdgeX-GoLang
Cc: Ahmad, Akram
Subject:
回复: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

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

收件人: sunjj@...; EdgeX-GoLang@...

抄送: 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


James.White2@...
 

Thanks Tony.  Yes, our team chatted about it and I have it teed up for Eric Cotter to work (Eric is the owner of all the supporting services from my team).  We lost the capability between Java and Go code for some reason.

 

Jianjiao – since you are the one that brought the attention to light, would you like to submit the issue?  Otherwise Tony or our team can.

 

Thanks

jim

 

From: Tony Espy [mailto:espy@...]
Sent: Wednesday, August 15, 2018 8:58 AM
To: White2, James; sunjj@...; EdgeX-GoLang@...
Cc: Ahmad, Akram
Subject: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

On 8/9/18 2:27 PM, James.White2@... wrote:

Jianjiao,

You may have identified a shortcoming in our Go work.  We are discussing internally.  Give me a bit of time to work this within the community and get back to you.

Jim --

This is a known issue, and was last discussed when Trevor brought up his structured logging proposal.

If you'd like, I can enter a github issue, as the same bug impacts the Go device SDK.

By the way, here's a good article which describes the problem:

https://dave.cheney.net/2015/11/05/lets-talk-about-logging

Regards,
/tony

p.s. I'd also like to see our loggingClient support builtin printf style formatting like the Go log package. I'll add an issue for that as well.



Jim

 

From: sunjj@... [mailto:sunjj@...]
Sent: Wednesday, August 08, 2018 1:59 AM
To: White2, James; EdgeX-GoLang
Cc: Ahmad, Akram
Subject:
回复: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

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

收件人: sunjj@...; EdgeX-GoLang@...

抄送: 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

 

sunjj@mingdutech.com
 

Hi Jim,
    I  submitted the issue just now(https://github.com/edgexfoundry/edgex-go/issues/484
Thanks,
Jianjiao


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

 
Date: 2018-08-15 23:12
Subject: Re: [Edgex-golang] How can I control the ouput of logs based on log level

Thanks Tony.  Yes, our team chatted about it and I have it teed up for Eric Cotter to work (Eric is the owner of all the supporting services from my team).  We lost the capability between Java and Go code for some reason.

 

Jianjiao – since you are the one that brought the attention to light, would you like to submit the issue?  Otherwise Tony or our team can.

 

Thanks

jim

 

From: Tony Espy [mailto:espy@...]
Sent: Wednesday, August 15, 2018 8:58 AM
To: White2, James; sunjj@...; EdgeX-GoLang@...
Cc: Ahmad, Akram
Subject: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

On 8/9/18 2:27 PM, James.White2@... wrote:

Jianjiao,

You may have identified a shortcoming in our Go work.  We are discussing internally.  Give me a bit of time to work this within the community and get back to you.

Jim --

This is a known issue, and was last discussed when Trevor brought up his structured logging proposal.

If you'd like, I can enter a github issue, as the same bug impacts the Go device SDK.

By the way, here's a good article which describes the problem:

https://dave.cheney.net/2015/11/05/lets-talk-about-logging

Regards,
/tony

p.s. I'd also like to see our loggingClient support builtin printf style formatting like the Go log package. I'll add an issue for that as well.



Jim

 

From: sunjj@... [mailto:sunjj@...]
Sent: Wednesday, August 08, 2018 1:59 AM
To: White2, James; EdgeX-GoLang
Cc: Ahmad, Akram
Subject:
回复: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

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

收件人: sunjj@...; EdgeX-GoLang@...

抄送: 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

 

James.White2@...
 

Perfect – thanks Jianjiao – I wanted to make sure you get credit for your participation in the project!

Jim

 

From: sunjj@... [mailto:sunjj@...]
Sent: Wednesday, August 15, 2018 7:58 PM
To: White2, James; espy@...; EdgeX-GoLang
Cc: Ahmad, Akram; Cotter, Eric
Subject: Re: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

Hi Jim,

    I  submitted the issue just nowhttps://github.com/edgexfoundry/edgex-go/issues/484

Thanks,

Jianjiao

 


孙建蛟 -- 研发部  IOT

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

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

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

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

话:0571-88196008   真:0571-86718570

箱:sunjj@mingdutech.com

 

From: James.White2

Date: 2018-08-15 23:12

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

Thanks Tony.  Yes, our team chatted about it and I have it teed up for Eric Cotter to work (Eric is the owner of all the supporting services from my team).  We lost the capability between Java and Go code for some reason.

 

Jianjiao – since you are the one that brought the attention to light, would you like to submit the issue?  Otherwise Tony or our team can.

 

Thanks

jim

 

From: Tony Espy [mailto:espy@...]
Sent: Wednesday, August 15, 2018 8:58 AM
To: White2, James; sunjj@...; EdgeX-GoLang@...
Cc: Ahmad, Akram
Subject: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

On 8/9/18 2:27 PM, James.White2@... wrote:

Jianjiao,

You may have identified a shortcoming in our Go work.  We are discussing internally.  Give me a bit of time to work this within the community and get back to you.

Jim --

This is a known issue, and was last discussed when Trevor brought up his structured logging proposal.

If you'd like, I can enter a github issue, as the same bug impacts the Go device SDK.

By the way, here's a good article which describes the problem:

https://dave.cheney.net/2015/11/05/lets-talk-about-logging

Regards,
/tony

p.s. I'd also like to see our loggingClient support builtin printf style formatting like the Go log package. I'll add an issue for that as well.




Jim

 

From: sunjj@... [mailto:sunjj@...]
Sent: Wednesday, August 08, 2018 1:59 AM
To: White2, James; EdgeX-GoLang
Cc: Ahmad, Akram
Subject:
回复: Re: [Edgex-golang] How can I control the ouput of logs based on log level

 

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

收件人: sunjj@...; EdgeX-GoLang@...

抄送: 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