[erlang-questions] Erlang logging system
Thu May 5 10:27:46 CEST 2011
On 5 May 2011 07:26, Chad DePue <> wrote:
> In the interests of bike shedding a bit here, we noticed a substantial
> performance hit for a client application that logged using error_logger so
> we wrote a simple log framework that uses macros to allow the caller to
> compile out the log statements at runtime for critical modules. You could
> extend it to also log to other logs like log4erl, fastlog, etc. Just the
> overhead of building the strings for the log, even if you aren't writing
> them out, can be quite expensive...
> Chad DePue
> skype: cdepue
Interesting. Fastlog doesn't build any string formats unless the
logging level you've asked for (on the specific "named" logger) is
active, although there will be a couple of function calls and a
message to one of the logger gen_server processes, but no actual write
to error_logger takes place unless the level is "switched on". It does
sound like compiling out even the unnecessary calls would be use for,
as you put it, very critical modules.
I'm also hoping to put disk_log support in to fastlog later on, as I
understand it's the most efficient mechanism available (bar using
macros to avoid logging at all).
More information about the erlang-questions