0

We have try to use lager as our log framework. But we meet some problem.

  1. lager may lost some date, we have saw the source code of lager, I think the reason is that gen_event notify is a async call, It doesn't guarantee to message receiving.

  2. lager performance is not good enough. I just guess it is because of lager's file backend is written by erlang. So it doesn't have a good performance.

So, I think a log framework written by C, and capsulated by Erlang may be a good choice.

Do you know any Erlang framework meet the requirements?

baotiao
  • 775
  • 6
  • 20
  • 1
    Lager's performance is not good enough and you think the solution is to use C? Are you seriously claiming that you profiled and found lager was CPU-bound and not disk bound? – Nathaniel Waisbrot Apr 25 '14 at 19:58
  • 1
    Lager actually changes to sync calls when it is overwhelmed. So chances are you are logging too much and you can't keep up. Then it slows down the application to be able to keep up. Consider making your own log infrastructure. The `disk_log` modules might come in handy. – I GIVE CRAP ANSWERS Apr 26 '14 at 10:17

1 Answers1

1
  1. lager create a event named 'lager_event' in the application.

  2. For every backend, there is only one gen_event process to handle it. Therefore if too many process generating messages at the same time, log will of course be lost at one specific time. It is not related to which language do you use.

Sugguest: 1. control log quantity. 2. get rid of the erlang's event system and create a jobs(tasks)'s subsystem (multi processes) to handle log.

Chen Yu
  • 3,955
  • 1
  • 24
  • 51