Skip to content

Commit cb2619b

Browse files
committed
Update example to show multiple loggers
1 parent 61ecf29 commit cb2619b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ Start-ScriptLogger
5757
# Second options, specify multiple custom settings for the logger
5858
Start-ScriptLogger -Path 'C:\Temp\test.log' -Format '{0:yyyy-MM-dd} {0:HH:mm:ss} {1} {2} {3,-11} {4}' -Level Warning -Encoding 'UTF8' -NoEventLog -NoConsoleOutput
5959
60+
# Start a second script logger with a dedicated name. The default script logger
61+
# is always named 'Default'
62+
Start-ScriptLogger -Name 'Logger2' -Path 'C:\Temp\test2.log'
63+
6064
# Get the current script logger configuration object
6165
Get-ScriptLogger
6266
@@ -78,6 +82,9 @@ Write-InformationLog -Message 'My Information Message'
7882
# Log a verbose message
7983
Write-VerboseLog -Message 'My Verbose Message'
8084
85+
# Write a log message into the log 2
86+
Write-InformationLog -Name 'Logger2' -Message 'My Information Message in Log 2'
87+
8188
# Disable the logger
8289
Stop-ScriptLogger
8390
```

0 commit comments

Comments
 (0)