erlang-shell mode in Emacs doesn't show the error_logger error

0

I like Emacs and Erlang too; I have set-up the erlang-mode and distel properly.

In my project,when dealing with the log,it doesn't show the

=ERROR REPORT==== 15-Sep-2012::14:09:30 ===

in the erlang-shell.

However in Windows it works. but, I like to develop on Ubuntu. Could anyone give me some advice on how to get it to work?

algking

Posted 2012-09-15T06:17:53.380

Reputation: 101

Did you try to log something on Linux using the Erlang shell? – None – 2012-09-17T07:05:25.317

[ {sasl, [
{sasl_error_logger, false},
{errlog_type, error},
{error_logger_mf_dir, "./logs"}, %% dirs {error_logger_mf_maxbytes, 1048760}, %% 10M per log file.
{error_logger_mf_maxfiles, 10} %% maxinum number of 10 ] } ] this is my sasl config
– algking – 2012-09-18T04:09:51.730

i can only get the log in my log file . In emacs using the erlang-shell-mode , when input the error_logger:error_msg("some_msg"). the erlang-shell can output someting like Eshell V5.9 (abort with ^G) 1> error_logger:error_msg("sdfsdf"). ok 2> =ERROR REPORT==== 18-Sep-2012::12:05:50 === sdfsdf2> but in my application just output ok: (algking@127.0.0.1)11> error_logger:error_msg("sdfsdf"). ok – algking – 2012-09-18T04:10:32.210

Answers

0

{sasl_error_logger, false} is your problem. That tells your Erlang node to turn off logging to the terminal and to plain text files. According to the manual, you can set it to either tty or {file, "mylog.txt"} to get log output.

You also have this in your config, though:

{error_logger_mf_dir, "./logs"}, %% dirs
{error_logger_mf_maxbytes, 1048760}, %% 10M per log file.
{error_logger_mf_maxfiles, 10}

That makes your Erlang node save error messages in a binary format in multiple files (hence mf) in ./logs. You can use the report browser (section 2.5, "Report Browser") to access them.

legoscia

Posted 2012-09-15T06:17:53.380

Reputation: 2 197

I have tried tty ,but it still doesn't work ,the problem is the same config and the same code works in the windows – algking – 2012-09-20T12:39:47.967

Hm, apart from that, the problem might be that sasl isn't started. Try application:start(sasl). – legoscia – 2012-09-20T13:50:22.833

I'm sure the sasl is started: application:start(sasl). {error,{already_started,sasl}}. I guess,maybe is some problem in the emacs ? or my erlang-shell-mode using in the emacs? – algking – 2012-09-22T06:55:37.673