I am trying to find the best method to format my PowerShell logging. What I am trying to achieve is the following. I want to precede all lines sent to the log file with the following:
[07-30-2020 17:15:44 -0700 INFO] yada yada yada …
So, precede log entries with [month-day-year hours:minutes:seconds timezone INFO] similar to Splunk logging.
I have no problems getting this format, but it seems like a performance hit to calculate the date/time information for each line logged (of which there are many). Is there a better way then running Get-Date for each line logged?
I should also point out this is all run through Start-Transcript.
Thanks in advance for any help/suggestions.