[erlang-questions] Lots of questions about error_logger

Ulf Wiger (TN/EAB) ulf.wiger@REDACTED
Mon Oct 13 09:20:19 CEST 2008


Sergey A. skrev:
> Hello.
> 
> In the first place, sorry for several different questions placed in
> one letter. I know it's something wearily to answer a list of
> questions.
> 
> I tried using error_logger as a tool for handling error reports and
> I've came across some oddities:
> 
> #1. Is there a way to set SASL options (I'm about sasl_error_logger,
> errlog_type etc) from the Erlang code at runtime without using a
> .config file + the "-config" argument? I just want to give an end user
> only one config file to edit and use values from that to setup SASL.

I guess application:set_env(App, Par, Val) is what you're after?

However, the function comes with a big fat warning:

"Use this function only if you know what you are doing, that is, on your 
own applications. It is very application and configuration parameter 
dependent when and how often the value is read by the application, and 
careless use of this function may put the application in a weird, 
inconsistent, and malfunctioning state."

(http://www.erlang.org/doc/apps/kernel/application.html)

Especially with things like the error logger, the value is expected
to be present from the beginning, and the warning is particularly
relevant.

If you don't want to mess with a config file, you can add the
parameters to the command line, using -App Par Val constructs.
Remember to escape special characters and omit spaces if you
want to declare complex terms this way. It's easy with simple
values, like

    erl -sasl error_logger_mf_maxbytes 100000


BR,
Ulf W





More information about the erlang-questions mailing list