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

性能非常差,并且会阻塞用户线程 #37

Open
liuzhiguo630 opened this issue Feb 25, 2021 · 0 comments
Open

性能非常差,并且会阻塞用户线程 #37

liuzhiguo630 opened this issue Feb 25, 2021 · 0 comments

Comments

@liuzhiguo630
Copy link

  1. 不应该调用 event.getCallerData(),爬栈的消耗极大。要不要调用这个方法,logback 自己会根据日志格式中有没有 %line自行判断。
  2. 不应该使用new String(this.encoder.encode(eventObject)),这条语句会导致 layout 的生成的 string 日志内容转成 byte[] 再转成 string,多复制了两份。
  3. 不应该直接调用 producer.send(),该方法在获取锁的时候会阻塞用户线程,当日志服务网络不稳定或达到上限时,用户线程默认会等待 60s。此处应该异步。
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

1 participant