Browsing error logs on a remote node
Wednesday, 18th May, 2011
First, set up your sasl
This config sets up a directory for rolling logs (max ten files, each max 10 megabytes). More configs on the man page.
% erl_config.config [ {sasl, [ {sasl_error_logger, false}, {error_logger_mf_dir, "/path/to/a/dir/for/erl/logs/"}, {error_logger_mf_maxbytes, 10485760}, % 10 MB {error_logger_mf_maxfiles, 10} ] } ].
And when you run erlang, tell it where your config file is:
erl -config /path/to/erl_config -boot start_sasl ... more args ...
n.b.:
- erlang expects the config file to have the extension .config, which you don’t give in the command line.
- the above config is cribbed from Programming Erlang. I was surprised to find that Erlang and OTP in Action does not describe how to configure the sasl error logger.
Connect and browse
Once you’re connected to the above node (see Connecting erlang nodes), you can run rb, the report browser. A little bit of set up is required. See this discussion on stackoverflow, which encapsulates the setup in a function:
%% @doc Start the report browser and reset its group-leader. %% For use in a remote shell start_remote_rb() -> {ok, Pid} = rb:start(), true = erlang:group_leader(erlang:group_leader(), Pid), ok.
Sunday, 5th June, 2011 at 3:03 pm
Thanks for pointing this out. If there’s ever a second edition of Erlang and OTP in Action, we’ll try to make sure configuration of SASL is described.
Monday, 6th June, 2011 at 7:32 am
Dear Richard
Thanks for your comment. To be fair I should also point out that the book is otherwise very good.
Ivan