-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Pslogg is a PowerShell module for logging messages to the PowerShell host or to PowerShell streams, and optionally to a log file.
Pslogg is designed to log messages from manually executed PowerShell scripts. For example for logging progress, and success or failure messages, when system administrators are running scripts to make changes to a system or deploy updates.
Pslogg has features designed to help administrators determine whether every step performed by a change script was successful or not:
-
Different logging levels can be displayed in different colors in the PowerShell console. For example, by default INFORMATION messages are displayed in white while ERROR messages are displayed in red.
-
User-defined Categories: Users may define categories that different log messages belong to. This facilitates filtering the log file and also allows different categories to be displayed in different colors in the PowerShell console. For example, by default messages with category "Success" are displayed in green while messages with category "Failure" are displayed in red. While there are several predefined Categories you can use, you have the option of adding your own and removing any of the pre-defined ones.
While Pslogg is designed around scripts that will be run manually, it can also be used in modules or other automated scripts. To facilitate wiring Pslogg output into monitoring tools or SIEM tools, Pslogg provides the option of routing output to PowerShell streams.
See the Quick Start page for how to install Pslogg, and the basics of writing log messages with it.
The Pslogg module exports four functions:
-
Write‐LogMessage: Writes log messages to the host or to a PowerShell stream, and optionally to a log file;
-
Get‐LogConfiguration: Retrieves a hash table which is a copy of the current configuration settings of the Pslogg module;
-
Set‐LogConfiguration: Sets one or more configuration settings. Use this function to set up the Pslogg module prior to writing any log messages;
-
Reset‐LogConfiguration: Resets the configuration back to its default settings.