1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
9
<holder>Ericsson AB, All Rights Reserved</holder>
12
The contents of this file are subject to the Erlang Public License,
13
Version 1.1, (the "License"); you may not use this file except in
14
compliance with the License. You should have received a copy of the
15
Erlang Public License along with this software. If not, it can be
16
retrieved online at http://www.erlang.org/.
18
Software distributed under the License is distributed on an "AS IS"
19
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20
the License for the specific language governing rights and limitations
23
The Initial Developer of the Original Code is Ericsson AB.
26
<title>nteventlog</title>
32
<module>nteventlog</module>
33
<modulesummary>Interface to Windows Event Log</modulesummary>
35
<p><c>nteventlog</c> provides a generic interface to the Windows
36
event log. It is part of the OS_Mon application, see
37
<seealso marker="os_mon">os_mon(6)</seealso>. Available for
38
Windows versions where the event log is available. That is, not
39
for Windows 98 and some other older Windows versions, but for most
40
(all?) newer Windows versions.</p>
41
<p>This module is used as the Windows backend for <c>os_sup</c>, see
42
<seealso marker="os_sup">os_sup(3)</seealso>.</p>
43
<p>To retain backwards compatibility, this module can also be used
44
to start a standalone <c>nteventlog</c> process which is not part
45
of the OS_Mon supervision tree. When starting such a process,
46
the user has to supply an identifier as well as a callback
47
function to handle the messages.</p>
48
<p>The identifier, an arbitrary string, should be reused whenever
49
the same application (or node) wants to start the process.
50
<c>nteventlog</c> is informed about all events that have arrived
51
to the eventlog since the last accepted message for the current
52
identifier. As long as the same identifier is used, the same
53
eventlog record will not be sent to <c>nteventlog</c> more than
54
once (with the exception of when graved system failures arise, in
55
which case the last records written before the failure may be
56
sent to Erlang again after reboot).</p>
57
<p>If the event log is configured to wrap around automatically,
58
records that have arrived to the log and been overwritten when
59
<c>nteventlog</c> was not running are lost. It however detects
60
this state and loses no records that are not overwritten.</p>
61
<p>The callback function works as described in <c>os_sup(3)</c>.</p>
65
<name>start(Identifier, MFA) -> Result</name>
66
<name>start_link(Identifier, MFA) -> Result</name>
67
<fsummary>Start the NT eventlog server</fsummary>
69
<v>Identifier = string() | atom()</v>
70
<v>MFA = {Mod, Func, Args}</v>
71
<v> Mod = Func = atom()</v>
72
<v> Args = [term()]</v>
73
<v>Result = {ok, Pid} | {error, {already_started, Pid}}</v>
77
<p>This function starts the standalone <c>nteventlog</c> process
78
and, if <c>start_link/2</c> is used, links to it.</p>
79
<p><c>Identifier</c> is an identifier as described above.</p>
80
<p><c>MFA</c> is the supplied callback function. When
81
<c>nteventlog</c> receives information about a new event, this
82
function will be called as <c>apply(Mod, Func, [Event|Args])</c> where <c>Event</c> is a tuple</p>
86
<name>stop() -> stopped</name>
87
<fsummary>Stop the NT eventlog server</fsummary>
89
<v>Result = stopped</v>
92
<p>Stops <c>nteventlog</c>. Usually only used during
93
development. The server does not have to be shut down
94
gracefully to maintain its state.</p>
100
<title>See Also</title>
101
<p><seealso marker="os_mon">os_mon(6)</seealso>,
102
<seealso marker="os_sup">os_sup(3)</seealso></p>
103
<p>Windows NT documentation</p>