Fredrik, Please see my inline comments.
Thanks, kaiduan On Mon, Nov 30, 2009 at 4:14 AM, Fredrik Thulin <f...@it.su.se> wrote: > On Fri, 2009-11-27 at 15:08 -0500, Kaiduan Xie wrote: >> Thank you Fredrik for the clarification on the rationale. > > You are most welcome. > >> In fact, spawning a process for each request is not creating >> performance bottleneck at all. I just want to understand the reason. >> >> Logger creates a lot of overhead in the code. Now no matter if the log >> level is big enough, YXA formats the message. I would like to see a >> log level in configuration, and check the log level before formatting >> the message. Ejabberd has nice way to do the log, it only reads the >> log level from configuration when system is up, and generates a module >> to handle the log. Whenever you need to log, it does not read from the >> configuration anymore. Anytime, you change the log level, it dynamic >> generates the logger module. > > Yes, (debug) logging is expensive in YXA today. > > Ejabberd's solution sounds neat, but I think it should be measured > against the much simpler variant of adding a case statement checking the > log level before calling format_msg in logger:do_log/3. Then we need to save the log level to ETS or Mnesia, and every time, you want to log, we need to read from ETS/Mnesia. Compared with other cost, for example, paring SIP message, reading ETS/Mnesia is not a big issue. But Ejabberd's solution is neat. I also would like to add line number and module name to the logger. Where can I check out the code from trunk? > Patches are always welcome. > > /Fredrik > > > _______________________________________________ Yxa-devel mailing list Yxa-devel@lists.su.se https://lists.su.se/mailman/listinfo/yxa-devel