nteventlog(3erl)
πΈ NAME πΈ
nteventlog β Interface to Windows Event Log β¨
okay so bestie, welcome to the nteventlog manual page (nteventlog(3erl), Erlang Module Definition, if we're being official about it π). It's the module that lets your Erlang code vibe with the Windows Event Log, and honestly? iconic.
π DESCRIPTION π
nteventlog gives you a generic interface to the Windows event log πͺβ¨. It's part of the OS_Mon application, so go peek at os_mon(7) if you want the whole picture.
This module is also the Windows backend for os_sup. See os_sup(3erl) β iykyk π«Ά.
Now, for the backwards compatibility girlies: you can still use this module to start a standalone nteventlog process that is not part of the OS_Mon supervision tree. And when you start a process like that, you have to hand over an identifier and a callback function to handle the messages. no cap, both are required π
.
The identifier is just an arbitrary string, and here's the trick β reuse it whenever the same application (or node) wants to start the process. nteventlog gets told about all the events that have arrived to the eventlog since the last accepted message for the current identifier. So as long as you keep using the same identifier, the same eventlog record will not be sent to nteventlog more than once. (One tiny exception: when graved system failures arise π, the last records written before the failure may be sent to Erlang again after reboot. tragic but true.)
And if the event log is configured to wrap around automatically, then records that arrived at the log and got overwritten while nteventlog wasn't running are justβ¦ gone. lost. π But β it detects this state, and it loses no records that are not overwritten. so it's fine bestie.
The callback function works exactly as described in os_sup(3erl) β.
β¨ EXPORTS β¨
π
start(Identifier, MFA) -> Result Β· start_link(Identifier, MFA) -> Result
Types:
Identifier = string() | atom()
MFA = {Mod, Func, Args}
Mod = Func = atom()
Args = [term()]
Result = {ok, Pid} | {error, {already_started, Pid}}
Pid = pid()
This function starts the standalone nteventlog process, and if you're using start_link/2, it links to it too π. main character energy fr fr.
Identifier is an identifier, exactly like the one described above π.
MFA is the supplied callback function. The moment nteventlog receives info about a new event, that function gets called as apply(Mod, Func, [Event|Args]), where Event is a tuple. π
π stop() -> stopped
Types:
Result = stopped
Stops nteventlog π. Usually only used during development, so don't stress. And good news β the server does not have to be shut down gracefully to maintain its state. slay.
π«Ά heads up bestie: stop() is the "I'm just testing things" button. It's literally built for dev-time messing around.
π SEE ALSO π
os_mon(7)os_sup(3erl)- Windows NT documentation
and that's the whole page, bestie!! π¦β¨ this icon of a manual page was brought to you by Ericsson AB π, from os_mon 2.8.2, and it lives at nteventlog(3erl). go forth and read your event log, queen ππΈ
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms