[erlang-questions] tracing process in a file

Bengt Kleberg bengt.kleberg@REDACTED
Wed Nov 15 15:51:18 CET 2006

On 2006-11-10 07:35, Surindar Sivanesan wrote:
> Dear all,
> I would like to trace  a process to a file when it starts at the background.
> Which module can help in achieving the above.

i never saw an answer to this question, so here is my suggestion:

dbg:tracer( process, fun(P, {fun{ok, Pid}) -> io:fwrite(Pid, "~p", [P]), 
{ok, Pid} end}, file:open( "afile", [write] )} )

the you should be able to do
dbg:tp(your_module, []).

or have a look at the dbg module for better granularity of traceing.

    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."

More information about the erlang-questions mailing list