Thor Logo dbatools

ErrorLog

Get-DbaErrorLog

Chrissy LeMaire (@cl), netnerds.net

Get-DbaErrorLog View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves SQL Server error log entries for troubleshooting and monitoring Description Retrieves entries from SQL Server error logs across all available log files (0-99, where 0 is current and 99 is oldest). Essential for troubleshooting SQL Server issues, monitoring login failures, tracking system events, and compliance auditing. Supports filtering by log number, source type, text patterns, and date ranges to quickly locate specific errors or events.

Read more

Get-DbaErrorLogConfig

Shawn Melton (@wsmelton), wsmelton.github.io

Get-DbaErrorLogConfig View Source Shawn Melton (@wsmelton), wsmelton.github.io Windows, Linux, macOS Synopsis Retrieves SQL Server error log configuration settings including file count, size limits, and storage location Description Retrieves current error log configuration from SQL Server instances, showing how many log files are retained, where they’re stored, and size limits if configured. This information helps DBAs understand log retention policies and troubleshoot logging issues without connecting to SQL Server Management Studio.

Read more

Invoke-DbaCycleErrorLog

Shawn Melton (@wsmelton), wsmelton.github.io

Invoke-DbaCycleErrorLog View Source Shawn Melton (@wsmelton), wsmelton.github.io Windows, Linux, macOS Synopsis Cycles the current SQL Server error log and/or SQL Agent error log to start fresh log files Description Archives the current error log files and creates new ones for SQL Server instance and/or SQL Agent. This operation is typically performed during maintenance windows to manage log file sizes and establish clean baselines for troubleshooting. When cycled, the current error log becomes the archived log (errorlog.

Read more

Set-DbaErrorLogConfig

Shawn Melton (@wsmelton), wsmelton.github.com

Set-DbaErrorLogConfig View Source Shawn Melton (@wsmelton), wsmelton.github.com Windows, Linux, macOS Synopsis Configures SQL Server error log retention and size rollover settings Description Configures how SQL Server manages its error log files by setting retention count and automatic rollover size. You can specify how many error log files to keep (6-99) across all SQL Server versions, and set the file size limit in KB for automatic rollover on SQL Server 2012 and later.

Read more