Erlang: Log to Files

http://journal.dedasys.com/2010/05/24/erlang-log-to-files

Erlang: Log to Files

Posted by  David N. Welton  on Monday, May 24, 2010

Since I had a heck of a time finding out how to do something that ought to be really easy, I thought I'd post what I found.  If you want Erlang to write errors to a file instead of stdout, add this to the command line:

-kernel error_logger '{file, "/tmp/erl.log"}'

Maybe there's a better solution, in which case feel free to correct me.

今天用了一下sasl_error_loger  发现日志信息无法写到日志文件里面只好用下面方式替换掉 sasl

改后

  1 [{kernel, [

  5      {error_logger, {file, "/home/jason/learn/erlang/log.log"}}             

  6     ]}].

原来:  

[{sasl, [

%% All reports go to this file

{sasl_error_logger, {file, "/home/joe/error_logs/THELOG" }}

]}].



你可能感兴趣的:(erlang)