File: log_mf_h.html

package info (click to toggle)
erlang-doc-html 1%3A11.b.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,284 kB
  • ctags: 10,724
  • sloc: erlang: 505; ansic: 323; makefile: 62; perl: 61; sh: 45
file content (101 lines) | stat: -rw-r--r-- 3,031 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>log_mf_h</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
  <STYLE TYPE="text/css">
<!--
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
  <IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>log_mf_h</H1>
</CENTER>

<H3>MODULE</H3>
<DIV CLASS=REFBODY>
log_mf_h
</DIV>

<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
An Event Handler which Logs Events to Disk
</DIV>

<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>

<P>The <CODE>log_mf_h</CODE> is a <CODE>gen_event</CODE> handler module which
can be installed in any <CODE>gen_event</CODE> process. It logs onto disk all events
which are sent to an event manager. Each event is written as a
binary which makes the logging very fast. However, a tool such as the <CODE>Report Browser</CODE> (<CODE>rb</CODE>) must be used in order to read the files. The events are written to multiple files. When all files have been used, the first one is re-used and overwritten. The directory location, the number of files, and the size of each file are configurable. The directory will include one file called <CODE>index</CODE>, and
report files <CODE>1, 2, ....</CODE>.


</DIV>

<H3>EXPORTS</H3>

<P><A NAME="init/3"><STRONG><CODE>init(Dir, MaxBytes, MaxFiles)</CODE></STRONG></A><BR>
<A NAME="init/4"><STRONG><CODE>init(Dir, MaxBytes, MaxFiles, Pred) -&#62; Args</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>MaxBytes = integer()</CODE></STRONG><BR>
<STRONG><CODE>MaxFiles = 0 &#60; integer() &#60; 256</CODE></STRONG><BR>
<STRONG><CODE>Pred = fun(Event) -&#62; boolean()</CODE></STRONG><BR>
<STRONG><CODE>Event = term()</CODE></STRONG><BR>
<STRONG><CODE>Args = args()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Initiates the event handler. This function returns
        <CODE>Args</CODE>, which should be used in a call to
        <CODE>gen_event:add_handler(EventMgr, log_mf_h, Args)</CODE>.


<P><CODE>Dir</CODE> specifies which directory to use for the log
files. <CODE>MaxBytes</CODE> specifies the size of each individual
file. <CODE>MaxFiles</CODE> specifies how many files are
used. <CODE>Pred</CODE> is a predicate function used to filter the
events. If no predicate function is specified, all events are
logged.

</DIV>

<H3>See Also</H3>
<DIV CLASS=REFBODY>

<P><A HREF="gen_event.html">gen_event(3)</A>, rb(3) 

</DIV>

<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Martin Bjrklund - support@erlang.ericsson.se<BR>

</DIV>
<CENTER>
<HR>
<SMALL>stdlib 1.14.2<BR>
Copyright &copy; 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>