Feature request: Central config for remote logging

Product: PowerShell Universal
Version: 2.6.2

Hopefully I did not miss this and it is not already available. What about a logging.ps1 configure file that allows you to write your own code to log elsewhere on top of local. I know you could include code in all your scripts but we have multiple people writing scripts in PS Universal. So a global config that you can send to a logging server would make sure all logging is secure for an auding department.

Not sure how many would use this but for companies with central logging repository and auditing tools it would be a nice to have.

If this is already a feature, sorry in advance.

This isn’t a feature currently but I’d like to understand it a bit more.

You are looking to get PSU server logs (like the ones available in %ProgramData%\PowerShellUniversal) along with logs from scripts to a central server?

We use a few 3rd party tools. Some uses cases I could think of

  1. Get data like what’s on jobs screen for auditors Who ran what and when. This also helps with other controls to prove processes where followed.
  2. Send failures to a 3rd party logging/alerting tool like nimsoft.
  3. Was thinking about some integration with MS teams when problems come up also.
    I know an api can be created and then every script would have to call that API and pass the data to it which may be the solution but does require people to add it to their scripts.
    Thank you for your time

You could use triggers for this kind of stuff right now. You could have scripts that trigger on job success and failure and then integrate with those things. It might be a good stopgap. There wouldn’t be a need to put the API calls in each script but rather hook up a trigger to all job events.

1 Like

I was looking at triggers, but reading though the document I think I miss understood that you had to set each trigger to a individual script. Reading it again it looks like you don’t have to assign triggers to specific scripts which is perfect for what I want. I am going to start playing with them.
Thank you for pointing me in the right direction.

1 Like