Write to Windows event log: Difference between revisions

→‎{{header|REXX}}: added the REXX language. -- ~~~~
(Added BBC BASIC)
(→‎{{header|REXX}}: added the REXX language. -- ~~~~)
Line 130:
win32evtlogutil.ReportEvent(applicationName, eventID, eventCategory=category,
eventType=myType, strings=descr, data=data, sid=my_sid)</lang>
 
=={{header|REXX}}==
This was executed on a (Microsoft) Windows/XP PRO system.
<lang rexx>/*REXX program writes a "record" (event) to the (MS) Windows event log.*/
 
eCMD = 'EVENTCREATE'
type = 'INFORMATION' /*one of: ERROR WARNING INFORMATION */
id = 234 /*in range: 1 ───► 1000 (inclusive).*/
logName = 'APPLICATION'
source = 'REXX'
desc = 'attempting to add an entry for Rosetta Code demonstration.'
desc = '"' || desc '"' /*enclose DESCription in double quotes.*/
 
eCMD '/T' type "/ID" id '/L' logName "/SO" source '/D' desc
 
/*stick a fork in it honey, we're done.*/</lang>
'''output'''
<pre style="overflow:scroll">
SUCCESS: A 'INFORMATION' type event is created in the 'REXX' log/source.
</pre>
 
=={{header|Ruby}}==
Line 138 ⟶ 158:
 
Instructions on setting up an Event Source is [http://rubyforge.org/docman/view.php/85/1734/mc_tutorial.html here]
 
=={{header|Tcl}}==
{{libheader|TWAPI}}