I’d like to define a logging target specific to a module I’m working on. For testing, I have the following in logging.ps1
New-PSULoggingTarget -Type "Database" -Properties @{
connectionString = 'Data Source=D:\log.db'
}
But I’m having 0 luck actually writing events to the database. I have created the database and created the table ‘Logs’. I’m using Write-PSUlog for testing. I see the log entries in the web console (Platform\Logging), but nothing is being written to the database.
It’s worth noting that if I use a File logging target logs are written to the file.
1..10 | Foreach-Object {Write-PSULog -Message (new-guid) -Level Information -Resource psiam -Feature Automation }
Product: PowerShell Universal
Version: 4.2.21
CREATE TABLE "Logs" (
"Id" INTEGER,
"Message" TEXT,
"MessageTemplate" TEXT,
"Level" TEXT,
"TimeStamp" TEXT,
"Exception" TEXT,
"Properties" TEXT,
PRIMARY KEY("Id")
)