Share via


Replication: SQLCESALOG: Is it possible to change the number of files and the size of each?

Yes it is.

Following the following KB article:     https://support.microsoft.com/kb/955968

In SP1 for SQL Server Compact 3.5 is different from previous versions. Please check KB article for differences.

MaxLogFileSize and MaxPreviousLogFiles are the two keys that we can use to alter the file size and increase the previous log files.

There is a minimum value for MaxLogFileSize (1 MB) and the default value for MaxPreviousLogFiles is 2.

When enabled, and each time IIS re-starts, a file will be kept in the log folder (up to 3 files created). This can be changed:

The SQL Server Compact 3.5 SP1 log management functionality limits how many old log files are kept on disk before these files are deleted.
Note By default, two old log files are kept on disk. You can configure this number to a maximum of 99. To do this, set the MaxPreviousLogFiles DWORD value for the following registry subkeys:

  • For SQL Server Compact 3.5 Client Agent logging:

    HKEY_CURRENT_USER\Software\Microsoft\Microsoft Sql Server Compact Edition\v3.5\Log\Sqlceca

  • For SQL Server Compact 3.5 Server Agent logging:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.5\Log\Sqlcesa

  • For SQL Server Compact 3.5 Replication Provider logging:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.5\Log\Sqlcerp

  • You can change the maximum size of a log file by setting the MaxLogFileSize DWORD value of the following registry subkeys.

For desktops

  • For SQL Server Compact 3.5 Client Agent logging:

    HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.5\Log\Sqlceca

  • For SQL Server Compact 3.5 Server Agent logging:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.5\Log\Sqlcesa

  • For SQL Server Compact 3.5 Replication Provider logging:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.5\Log\Sqlcerp

For devices

  • For SQL Server Compact 3.5 Client Agent logging:

    HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.5\Log\Sqlceca

Notes

  • There is no maximum value for the MaxLogFileSize value.
  • The minimum value for the MaxLogFileSize value for desktops is 1024 kilobytes (KB). For devices, the maximum is 512 KB.
  • For SQL Server Compact 3.5 Client Agent logging, log file rotation occurs every time that an application or a process that uses SQL Server Compact is started.
    For SQL Server Compact 3.5 Server Agent logging and for SQL Server Compact 3.5 Replication Provider logging, log file rotation occurs every time that IIS is restarted.
  • If there are no registry entries for log file rotation, rotation occurs with the following default values as soon as logging is enabled:
    • MaxPreviousLogFiles: 2
    • MaxLogFileSize: 1024 (1 MB)

NOTE: If the registry keys are not found in the Registry, then you will have to create them. You will have to create (for example) a key for LOG, a key for Sqlcesa and then a DWORD reflecting the alteration you want (log file size or number).