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

日志输出能否优化 #24

Open
ZhouZhaoJi opened this issue Sep 2, 2021 · 4 comments
Open

日志输出能否优化 #24

ZhouZhaoJi opened this issue Sep 2, 2021 · 4 comments

Comments

@ZhouZhaoJi
Copy link

  1. 我能否将不同的模块的日志输出到不同的地方,而不是都输出到一个文件。
  2. 我能否通过配置文件配置日志消息的格式。
  3. 我还想通过时间间隔滚动日志。
    就像log4cplus一样。我的模块就是用log4cplus作输出的,这样配置人员就要搞两个配置文件,一个是log4cplus的配置文件,另外一个就是nebula的配置文件,里面都有一个log的配置,会让人很疑惑。我原本打算直接调用nebula的log接口,但是这log的接口太简单了,很多特别的日志输出需求完全配置不了。这只是一个优化的建议。
@ZhouZhaoJi
Copy link
Author

我还是用nebula的接口实现吧,为了一致性的考虑。

@Bwar
Copy link
Owner

Bwar commented Sep 2, 2021

早期的nebula版本也是用log4cplus的,后来为了加网络日志做log trace把log4cplus移除了。按时间滚动日志容易实现,像log4cplus那样配置日志消息格式也不难,不过最近比较忙,暂不会将日志这个优化排入开发计划,欢迎提交PR。按模块输出到不同地方,这模块指的是什么?

@ZhouZhaoJi
Copy link
Author

模块是指按照类来输出日志,比如foo类就输出到foo.log。或者更具体地,我要将一部分重要的执行日志输出到一个单独的文件。在log4cplus,我只要通过get不同的logger就可以实现。

@ZhouZhaoJi
Copy link
Author

或者比如不同的cmd的执行过程,放到不同的日志文件中。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants