Jump to content

Windows Event Logging


Recommended Posts

QUOTE (mesmith @ Sep 22 2008, 12:36 PM)

Thanks for the link.

I checked it out, and it works _except_ that for Vista, the first time you create a log, you have to be running as Administrator. The right way to do it is to do that with some custom code in the installer. What a pain.

Link to comment
  • 5 years later...

Reviving this topic. Anybody have a native interface, or something that exposes a network API for RT targets? I have a multilingual app and need to log events from all sources to a common file in Windows, so NI's tools aren't an option. (Stupid walled garden!)

Link to comment
Reviving this topic. Anybody have a native interface, or something that exposes a network API for RT targets? I have a multilingual app and need to log events from all sources to a common file in Windows, so NI's tools aren't an option. (Stupid walled garden!)

We have something but it doesn't go to a native windows log; it goes to our own log. It runs as a service and grabs messages via UDP, so messages can be published from RT and Host PCs, and logs them to files. Also comes with a standalone GUI and has different levels of customization for message filtering, along with an ActiveX control and API. Does this sound like something that would meet your needs? I can't promise anything because I know we wrap this into bids to customers so it wouldn't be freeware. Either way, I'd like to see if there is some demand for this type of thing out there.

Edited by for(imstuck)
Link to comment

Stobber: have you considered creating a logger actor (service/subsystem/agent) dedicated to performing this action? Other actors in your system, when they want to write an event to the log, would not perform the log write themselves; rather, the event is brokered through this Logger Actor, which contains all procedural behavior for writing to the Windows Event Log.

 

The logger subsystem would provide a VI called "Serialize to Syslog" which has no dependencies (including, not being contained within the logger's library/class). This means that any arbitrary system in your application only needs two things: 1) a lightweight, dependency-less method to serialize into your log format du juor, and 2) access to the endpoint (actor reference/address/mailbox/enqueuer) of the logger actor.

 

I've had good success logging within a single actor (rather than as a distributed effort throughout the system) since the disk (or generally, log store) is a shared resource. The logger actor can do things like batch writes, and it generally frees your other systems from this otherwise expensive, blocking action.

 

This doesn't answer your original question, per se, but could at least contain the Event Logger API to a single actor on the Windows target.

 

 

***EDIT: This method is not unlike the LabVIEW Syslog Protocol Reference Library linked by Phillip, except you'd be using your existing actors and transport mechanisms. Perhaps you can pluck the APIs from that reference library and plug them into your own system...***

Edited by JackDunaway
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.