olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

Log Files format #506

Closed madrianr closed 2 years ago

madrianr commented 3 years ago

Hallo,

it would be useful if the format of the log files will be cleaner - now there are no line breaks between database backups and there are many informations which are not nessessary... so it is very difficult to find errors - every line ends with "[SQLSTATE 01000]" and thats make the file unreadable

robert

olahallengren commented 2 years ago

The [SQLSTATE 01000] is added to the output file by SQL Server Agent, when you are using the T-SQL job step type. Unfortunately I have no control of that. If you look at the output, when you execute the stored procedures in SSMS or sqlcmd, it is not there.

With regards to line breaks, they should be there. Could you post an example of an output -file here?

madrianr commented 2 years ago

Date and time: 2022-01-01 23:00:01 [SQLSTATE 01000] Server: SQL [SQLSTATE 01000] Version: 15.0.2080.9 [SQLSTATE 01000] Edition: Standard Edition (64-bit) [SQLSTATE 01000] Platform: Windows [SQLSTATE 01000] Procedure: [master].[dbo].[IndexOptimize] [SQLSTATE 01000] Parameters: @Databases = 'USER_DATABASES', @FragmentationLow = NULL, @FragmentationMedium = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE', @FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE', @FragmentationLevel1 = 5, @FragmentationLevel2 = 30, @MinNumberOfPages = 1000, @MaxNumberOfPages = NULL, @SortInTempdb = 'N', @MaxDOP = NULL, @FillFactor = NULL, @PadIndex = NULL, @LOBCompaction = 'Y', @UpdateStatistics = NULL, @OnlyModifiedStatistics = 'N', @StatisticsModificationLevel = NULL, @StatisticsSample = NULL, @StatisticsResample = 'N', @PartitionLevel = 'Y', @MSShippedObjects = 'N', @Indexes = NULL, @TimeLimit = NULL, @Delay = NULL, @WaitAtLowPriorityMaxDuration = NULL, @WaitAtLowPriorityAbortAfterWait = NULL, @Resumable = 'N', @AvailabilityGroups = NULL, @LockTimeout = NULL, @LockMessageSeverity = 16, @StringDelimiter = ',', @DatabaseOrder = NULL, @DatabasesInParallel = 'N', @ExecuteAsUser = NULL, @LogToTable = 'N', @Execute = 'Y' [SQLSTATE 01000] Version: 2020-12-31 18:58:56 [SQLSTATE 01000] Source: https://ola.hallengren.com [SQLSTATE 01000] [SQLSTATE 01000] Date and time: 2022-01-01 23:00:02 [SQLSTATE 01000] Database: [AppMng_Service_DB_afab5cd5c19b4334a6333eadb43680d0] [SQLSTATE 01000] State: ONLINE [SQLSTATE 01000] Standby: No [SQLSTATE 01000] Updateability: READ_WRITE [SQLSTATE 01000] User access: MULTI_USER [SQLSTATE 01000] Recovery model: FULL [SQLSTATE 01000] Is accessible: Yes [SQLSTATE 01000] [SQLSTATE 01000]

olahallengren commented 2 years ago

This looks as expected.

One issue with the SQL Server Agent T-SQL job step type, is that empty lines are removed. As a workaround, I output a line with a tab character only, You will see that as a line with [SQLSTATE 01000] only.

madrianr commented 2 years ago

OK