[erlang-questions] disk_log question

Bengt Kleberg bengt.kleberg@REDACTED
Wed Apr 22 10:44:21 CEST 2009


Greetings,

>From the documentation (http://erlang.org/doc/man/disk_log.html):

"A process that opens a disk log can either be an owner or an anonymous
user of the disk log. Each owner is linked to the disk log process, and
the disk log is closed by the owner should the owner terminate."

If you open as an owner and if your shell crashes when the module
returns an error (badmatch?) the log will be closed.
Could this be what is happening?


bengt

On Wed, 2009-04-22 at 14:05 +0530, Amit Murthy wrote:
> Hi,
> 
> I want to use disk_log with an external format for application info
> logging. I was experimenting with disk_log in the console and I found
> the following behavior:
> 
> On an opened (opened via the open() call) log , once any of the
> functions in the module return any, and I mean ANY error, the log gets
> closed and is no longer available.
> All subsequent calls return {error,no_such_log}.
> 
> Even an error like "** exception error: undefined function
> disk_log:xxxxx/2" results in the same behavior.
> 
> I wanted to open a single log at startup and use it for logging in all
> the other functions. Now, this may not be right way to do it, since if
> any of the logging calls return an error, the log gets effectively
> closed.
> 
> Is there any explanation for this? Or is there a better way to
> implement application error/info logging?
> 
>   Amit
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list