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?

3
  • Did you try to log something on Linux using the Erlang shell?
    – user601836
    Sep 17, 2012 at 7:05
  • [ {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
    Sep 18, 2012 at 4:09
  • 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
    Sep 18, 2012 at 4:10

1 Answer 1

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.

3
  • 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
    Sep 20, 2012 at 12:39
  • Hm, apart from that, the problem might be that sasl isn't started. Try application:start(sasl).
    – legoscia
    Sep 20, 2012 at 13:50
  • 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
    Sep 22, 2012 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.