I’m curious what people here use for robust logging.
I’ve been searching for ways to incorporate logging into my scripts. For example, I’m looking for a consistent way to log data to a .log file somewhere locally on the system running the scripts. The data I’m looking for is:
-What the script is doing
-Any errors encountered
-Completion of Script with time stamp
I’ve seen some examples out there, but they all involve just sending manually entered text to a log file. What I’d like is something that can accept pipeline input and have that appear in the log. (Ex: Get-Service | Write-Log). Or have the entire contents from the Start/Stop-Transcript piped to a log file.
What have you come across that you’ve found to work well? Any recommendations?