Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于logx日志打印 #433

Closed
zhuxubin01 opened this issue Feb 3, 2021 · 17 comments
Closed

关于logx日志打印 #433

zhuxubin01 opened this issue Feb 3, 2021 · 17 comments
Assignees
Labels
enhancement New feature or request stale

Comments

@zhuxubin01
Copy link

用logx打印的时候 能否指定打印出行号和函数名之类的

@kevwan
Copy link
Contributor

kevwan commented Feb 3, 2021

info没有打印,但是error等打印了的,因为info的日志太多了,也不太需要知道哪里打印的

@shiquan1988
Copy link

shiquan1988 commented Feb 19, 2021

是否考虑支持下structured log呢,类似

image

我们需要把一些业务字段记录在日志中,在kibana上绘制成图表,非常依赖这个,应该是个通用的需求

@kevwan
Copy link
Contributor

kevwan commented Feb 20, 2021

我考虑下哈

@to2false
Copy link

to2false commented Mar 17, 2021

@kevwan 能否也定义下log interface?这样开放出来可以自定义
如果在老项目(非go-zero) 想用core下部分组件的时候,发现logx的直接出现在某些组件里,这样我需要配置下logx控制日志输出,这样存在两份log配置,如果能直接老项目适配interface操作起来方便点

@zljohn-ux
Copy link

说下log的需求哈
1,不支持所有的级别打印文件行号或函数名, 建议将权限下放由用户开启开关,而不是设死
2,日志打印级别不支持withfield,很多业务场景需要附带一些必要参数
3,打印日志级别 没有debug warn等
感觉日志更像定制化,而不是通用的可自定义选项的插件

@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Aug 19, 2021
@kevwan kevwan self-assigned this Sep 1, 2021
@kevwan kevwan added enhancement New feature or request and removed stale labels Sep 1, 2021
@github-actions
Copy link

github-actions bot commented Oct 2, 2021

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Oct 2, 2021
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@congim
Copy link
Contributor

congim commented Aug 22, 2022

@zljohn-ux 非常好的建议,希望作者支持下
1,不支持所有的级别打印文件行号或函数名, 建议将权限下放由用户开启开关,而不是设死
2,日志打印级别不支持withfield,很多业务场景需要附带一些必要参数
3,打印日志级别 没有debug warn等

@kevwan go-zero是一款非常优秀的框架,希望能在通用的细节点上听取一下大家的建议,毕竟go-zero不是针对一家的定制产品

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@zljohn-ux is a very good suggestion, I hope the author will support it

  1. It does not support printing file line numbers or function names at all levels. It is recommended to decentralize permissions and turn on the switch by the user instead of setting it to death.
  2. The log printing level does not support withfield, and many business scenarios need to be accompanied by some necessary parameters
  3. Print log level without debug warn, etc.

@kevwan
Copy link
Contributor

kevwan commented Aug 22, 2022

@zljohn-ux 非常好的建议,希望作者支持下 1,不支持所有的级别打印文件行号或函数名, 建议将权限下放由用户开启开关,而不是设死 2,日志打印级别不支持withfield,很多业务场景需要附带一些必要参数 3,打印日志级别 没有debug warn等

@kevwan go-zero是一款非常优秀的框架,希望能在通用的细节点上听取一下大家的建议,毕竟go-zero不是针对一家的定制产品

  1. 已支持
  2. withfield已经支持
  3. debug/warn我觉得有点多余,go也没支持warning呀,支持了的话就会大家丢一堆冗余打印在代码里

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@zljohn-ux is a very good suggestion. I hope the author will support 1. It does not support printing file line numbers or function names at all levels. It is recommended to decentralize permissions and turn on the switch by the user instead of setting it to death. 2, the log printing level does not support withfield , many business scenarios need to be accompanied by some necessary parameters 3, the print log level does not have debug warn, etc.

@kevwan go-zero is a very good framework, I hope to listen to everyone's suggestions on general details, after all go-zero is not a customized product for one family

  1. Supported
  2. withfield is already supported
  3. I think debug/warn is a bit redundant. Go does not support warning. If it supports it, everyone will throw a bunch of redundant prints in the code.

@congim
Copy link
Contributor

congim commented Aug 22, 2022

debug/warn 多余这点就是我上面说的,go-zero是一个使用非常广泛的工具,debug和warn的使用场景我觉得应该交给用户来决定,而不是单纯的我认为多余。如果从语言的角度上说go不支持,那么我可不可以用zap、log4j来反驳呢?总之我的观点还是有些功能选择权尽量放给用户

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The redundant debug/warn is what I said above. go-zero is a very widely used tool. I think the usage scenarios of debug and warn should be left to the user to decide, not simply I think it is redundant. If go does not support it from a language point of view, can I use zap and log4j to refute it? In short, my point of view is that some function choices are left to the user as much as possible.

@kevwan
Copy link
Contributor

kevwan commented Aug 22, 2022

debug/warn 多余这点就是我上面说的,go-zero是一个使用非常广泛的工具,debug和warn的使用场景我觉得应该交给用户来决定,而不是单纯的我认为多余。如果从语言的角度上说go不支持,那么我可不可以用zap、log4j来反驳呢?总之我的观点还是有些功能选择权尽量放给用户

If so, we need to open all the configuration. I think it's a decision choice. Maybe later.

@congim
Copy link
Contributor

congim commented Aug 23, 2022

debug/warn 多余这点就是我上面说的,go-zero是一个使用非常广泛的工具,debug和warn的使用场景我觉得应该交给用户来决定,而不是单纯的我认为多余。如果从语言的角度上说go不支持,那么我可不可以用zap、log4j来反驳呢?总之我的观点还是有些功能选择权尽量放给用户

If so, we need to open all the configuration. I think it's a decision choice. Maybe later.

Respect your decision.

@ixuer
Copy link

ixuer commented Nov 10, 2023

It seems warn level logs are not supported yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

8 participants