From b3c1f0137dfe05f1159801b90595ed433f53560f Mon Sep 17 00:00:00 2001 From: Josh Elster Date: Mon, 6 Feb 2017 13:04:34 -0600 Subject: [PATCH 1/2] Hobo implement tail display of SQL App log events --- windows/mssql-server-windows-express/start.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/windows/mssql-server-windows-express/start.ps1 b/windows/mssql-server-windows-express/start.ps1 index 8d52d04b..a0c3f605 100644 --- a/windows/mssql-server-windows-express/start.ps1 +++ b/windows/mssql-server-windows-express/start.ps1 @@ -54,4 +54,9 @@ if ($null -ne $dbs -And $dbs.Length -gt 0){ } Write-Verbose "Started SQL Server." -while ($true) { Start-Sleep -Seconds 3600 } +$lastCheck = (Get-Date).AddSeconds(-2) +while ($true) { + Get-EventLog -LogName Application -Source "MSSQL*" -After $lastCheck | Select-Object TimeGenerated, EntryType, Message + $lastCheck = Get-Date + Start-Sleep -Seconds 2 +} From d712478aa7c4a72bdba70be72a17b1d6d692596b Mon Sep 17 00:00:00 2001 From: Josh Elster Date: Mon, 6 Feb 2017 16:11:33 -0600 Subject: [PATCH 2/2] apply event log to stdout change to other start script --- windows/mssql-server-windows/start.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/windows/mssql-server-windows/start.ps1 b/windows/mssql-server-windows/start.ps1 index bf5e2f72..ac00ed57 100644 --- a/windows/mssql-server-windows/start.ps1 +++ b/windows/mssql-server-windows/start.ps1 @@ -54,4 +54,9 @@ if ($null -ne $dbs -And $dbs.Length -gt 0){ } Write-Verbose "Started SQL Server." -while ($true) { Start-Sleep -Seconds 3600 } +$lastCheck = (Get-Date).AddSeconds(-2) +while ($true) { + Get-EventLog -LogName Application -Source "MSSQL*" -After $lastCheck | Select-Object TimeGenerated, EntryType, Message + $lastCheck = Get-Date + Start-Sleep -Seconds 2 +}