error_logger and sasl

Vance Shipley <>
Tue Jun 7 01:46:06 CEST 2005


On Tue, Jun 07, 2005 at 12:57:15AM +0200, Ulf Wiger wrote:
}  
}  One issue with run_erl/to_erl is that you get into trouble
}  if two users use to_erl simultaneously towards the same
}  erlang node. Nothing prevents this from happening, but the
}  results will be confusing (run_erl sends all output to the
}  same named pipe and the two to_erl processes compete for
}  read access.)


What I have been doing is to have normal access to the node 
done using "erl -sname $USER -remsh embedded@`hostname`"
which has each user working in their own home directory
accessing the system using their own node.  Access to to_erl
is then limited to those cases where it is really needed.

The difference with this is that you won't see the error_logger
output to tty.  This may be good or bad.  In one of our systems 
there is a lot of verbose reporting going on which would
otherwise confuse the operator trying to enter commands.  This
may be especialy true if she is trying to take corrective 
actions for ongoing problems.  In order to stop the errors
she has to run some commands.  Being free from the error
reports coming out on the screen makes this much easier.  

At other times we want to see some or all of the error_logger
reports.  For this I wrote an event handler for the error_logger
which forwards specified report types to a remote error_logger
process.  When a user wants to see, for example, error_report &
info_report messages generated on  sent to the 
error_logger process running on :

()1> gen_event:add_handler({error_logger, ''},
 forward_error_logger, [[error_report, info_report], whereis(error_logger)]).

This causes the forward_error_logger handler to be installed
at  and the error_report & info_report reports to
(also) be sent to the local error_logger at 

Of course I also put that into a simple command in a user_default
module so the user only needs to do:

()1> log(sasl).
ok

	-Vance





More information about the erlang-questions mailing list