4.x Logging.ps1 How To

I’ve configured logging as shown below and the results are confusing. My goal is system logging at error level going to a file, and user logging for API at information level going to a file. The code below produces neither result. The directory exists. I still see system logging going to the original ProgramData directory. I see no API logging at all any longer.

New-PSULoggingTarget -Type “File” -Level “Error” -Properties @{
path = ‘E:\PULogs\system.log’
} -Scope “System”
New-PSULoggingTarget -Type “File” -Level “Information” -Feature “API” -Properties @{
path = ‘E:\PULogs\api.log’
} -Scope “User”

Product: PowerShell Universal
Version: 4.1.7

Correction from an earlier post.

When using Write-PSULog from within an API endpoint, the message is not visible from within API logging. It is visible within the system log along with everything else going on in PU.

Is it possible to create custom logging messages that will appear within the API log files rather than the global log files? For each endpoing, there is a link to its log messages. Why doesn’t that display the log messages created explicitly by the endpoint code?