Showing results for 
Search instead for 
Did you mean: 

How do I write/read entries to a system.log or security.log file?

I need my application program to be able to do this (write to a log file) in order to create an audit trail.  For instance if there are failed login attempts on a security enabled program, these events need to be logged so the system administrator can be made aware of them.




0 Kudos
Message 1 of 2

In the most basic terms create and open a file, format a string for the message you want to include and then write to the file. The basic VIs required to do this can be found on the Files pallet. How complex you make you logging process is up to you. For instance the LVOOP logging class we use has many features such as limits on the file size (it will open a new file when the current file reaches a specified limit), include data/time stamps in teh file names, allow messages to be queued and buffer the files writes, automatic flush of any queued messages after a specified period of time, creating new logs on some time boundary (day, week, month, etc.) as well as many other types of features. It may help if you provide some code of what you have attempted so far.

Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 2