(imported topic written by RichB91)
I have a requirement to write assorted custom information to a log file on the managed devices from within Actions. It could use either the existing Client Logs found in…
• Windows: C:\Program Files\BigFix Enterprise\BES Client__BESData__Global\Logs
• Unix/Linux: /var/opt/BESClient/__BESData/__Global/Logs
…or it could use a log file of our own creation. It could be a .txt file or .xml if that is more elegant.
It would need to work on both Windows & Unix (no Mac requirement at this time).
I would prefer, but not require, that it not use the appendfile command. For a small file it may not be a problem. But for large files, the action of duplicating the original file to _append file, appending the new line, deleting (or backing up and deleting) the original file and then moving the _appendfile to the original name & location appears to me to be more drive and CPU intensive than necessary.
On Windows I could use something like:
// store OS specific file location and name
if {name of operating system as string as lowercase contains “win”} then parameter “filename” = “C:\Company_Tools\BigFix\Logs\Custom-Log.txt” else parameter “filename” = “/var/opt/apps/tools/bigfix/logs/Custom-Log.txt”
waithidden cmd.exe /C echo.mycustomtextline1>> parameter “filename”
waithidden cmd.exe /C echo.mycustomtextline2>> parameter “filename”
But this won’t work for Unix.
Can/should custom messages be written to the existing Client Log files?
If so, how?
If not, how could custom messages be appended to an existing file without the overhead generally created by doing a three-point-turn with _appendfile?
Would editing an .xml file instead of appending a .txt make the process easier?
-RichB