Settings - Log Settings
The Log settings tab controls what the Server logs and where: the Server log file, the Windows event log, the log database with its retention limits, and how much Task output is stored. Use it to keep the logs you need without filling the disk. This tab is one of the tabs of the Server settings window (see Main - Settings). It has four sub tabs: Settings, Error and diagnostics, Database settings and Output settings.
Settings sub tab
Server -> Main settings -> Settings -> Log settings -> Settings

- Extended debug logging: writes extra debug entries to the Server log, for example the result lines of Variable conditions. VisualCron support may ask you to turn it on. Turn it off again afterwards, because it adds load to the Server and makes the log grow faster. Unchecked by default
- Log to event log: also writes the Server's log entries to the Windows event log. Unchecked by default
- Log to file -> Server events: writes the Server's log entries to a file in the Log folder (see Settings - Folders), by default the
logfolder in the VisualCron installation folder (C:\Program Files (x86)\VisualCron\logon 64-bit Windows). Checked by default
The Server starts a new log file each day, named "log_server<yyyyMMdd>.txt", as soon as it logs its first entry that day. The Client writes its own log file, "log_client<yyyyMMdd>.txt", in the Client's log folder, by default %LOCALAPPDATA%\VisualCron\log of the Windows user who runs the Client. You turn that on, and can change the folder, in the Client settings (see Settings - Client Settings).
The built-in Job "Delete old log files" runs every day at 23:10. It deletes ".txt" files in the Log folder that were created more than one month ago. To keep log files longer, change the age condition of its Task, or deactivate the Job (see Task File - Delete File).
Error and diagnostics sub tab
Server -> Main settings -> Settings -> Log settings -> Error and diagnostics

- Send unhandled server errors to VisualCron: sends details of unexpected Server errors to VisualCron, so that the errors can be found and fixed. Checked by default
- Send anonymous diagnostics and usage data: sends anonymous diagnostics and usage data to VisualCron to help improve the product. Checked by default
Both options are on when VisualCron is installed. If your security policy does not allow the Server to send data outside your network, uncheck both and click Apply settings.
Database settings sub tab
The Server stores its logs in a log database: Job and Task runs with their output, the Audit log, the Server log and more. By default this is an internal SQL Server Compact database on the Server computer. You can use an external SQL database instead (see Move logging to an external database).
Server -> Main settings -> Settings -> Log settings -> Database settings

- Log to database: logs to the log database, internal or external. Checked by default. When unchecked, the Server does not store Job and Task runs, output or other log entries in a database
- Log DB location: "Internal" (default) or "External"
- Copy database: copies log data from one log database to another (see Move logging to an external database)
With "Internal", the Database info box shows the Location and Size of the internal database file.
With "External", the External database info box shows:
- Connection: the SQL Connection of the external database (see Connection - SQL)
- Credential: the Credential the Server uses to connect, if the database uses Windows authentication
- Create DB tables: creates the log tables in the external database. Available until the tables exist. If you click Apply settings with "External" before the tables exist, VisualCron shows "First you have to click create tables in the database!" and does not save. Create DB tables acts at once, without Apply settings
- Drop all tables: shown next to Create DB tables. When checked, Create DB tables deletes the existing log tables first, after you confirm
- Command Timeout (seconds, 0 for infinite timeout): how long the Server waits for a database command. The default is "90"
Create DB tables creates these tables: "AuditLogs", "ConnectionLogs", "DBVersions", "EventLogs", "GeneralLogs", "HealthLogs", "JobLogs", "NotificationLogs", "ServerStats", "TaskLogs" and "TransferLogs".
Drop all tables deletes all log data in the external database's log tables. Use it only for a database whose log data you do not need.
Limits for each log
Below the database box, each log has its own box: General logs, Audit logs, Job logs, Task logs, Notification logs, Server stats, Health logs, Event logs, Connection logs and Transfer logs. Each box shows:
- Rows and Range: the number of rows and the date range of that log
- Keep a maximum of
<n>rows in database: when checked, the Server deletes the oldest rows above this number. Up to "1000000" - Delete rows older than
<n>days: when checked, the Server deletes rows older than this number of days. Up to "365" - Clear all: deletes all rows of that log
- Recreate table (external database only): deletes the log's table and creates it again, empty
- Rebuild indexes (external Microsoft SQL Server database only) and Indexes average fragmentation: rebuild the table's indexes at once, without Apply settings, and show how fragmented they are
- Query statistics: statistics of the database queries for that log; double-click to expand or collapse
The DB version box shows the version of the log database.
Clear all and Recreate table delete the rows at once, without asking you to confirm. They do not wait for Apply settings, and Cancel does not bring the rows back. They act on the database selected on this sub tab, also when that is not the database the Server logs to, and they are not written to the Audit log.
The default limits are:
| Log | Keep a maximum of | Delete rows older than |
|---|---|---|
| General logs | 5000 rows, checked | 14 days, unchecked |
| Audit logs | 20000 rows, checked | 30 days, checked |
| Job logs | 10000 rows, checked | 30 days, checked |
| Task logs | 20000 rows, checked | 30 days, checked |
| Notification logs | 10000 rows, checked | 30 days, checked |
| Server stats | 100000 rows, unchecked | 30 days, checked |
| Health logs | 10000 rows, checked | 30 days, checked |
| Event logs | 10000 rows, checked | 30 days, checked |
| Connection logs | 10000 rows, checked | 30 days, checked |
| Transfer logs | 10000 rows, checked | 30 days, checked |
How the limits are applied
The Server does not apply the limits when you click Apply settings. A cleanup applies them about every 11 hours, counted from when the VisualCron service started. The internal database is also cleaned up when it is full (see Internal database size and cleanup). If the service is restarted more often than every 11 hours, the scheduled cleanup does not run.
When both limits of a log are checked, the cleanup applies both: it keeps no more than the maximum number of rows, and no rows older than the number of days. Whichever removes more rows decides what is left. For example, with Delete rows older than "15" days and Keep a maximum of "20000" rows on the Task log, a Server that writes 10000 Task log rows a day keeps only about two days of Task history. To keep the full number of days, raise the row limit or uncheck it.
Output settings sub tab
Server -> Main settings -> Settings -> Log settings -> Output settings

- Limit output size: how many characters of each Task's output are stored in its Task log entry and with the Task's last result. The default is "20480". You cannot turn this limit off. Store full output (below) keeps a full copy in addition
- Max output size: the most output, in characters, a Task can produce while it runs. The default is "2147483647". Output beyond this size is not cut off: the Task stops with the error "Output out of range. Please check Max output size on Server settings" and exit code "77777", unless its On error tab ignores the error type "Output data out of range". Flow conditions, On error conditions, Conditions that check a Task's output, Variables that return a Task's output, and Run Task and Web API requests that return output work with the output up to this size, not with the limited output
- Store full output: also stores each Task's full output, up to Max output size, in the Task log, so that you can view the complete output of earlier runs. Available only while Log to database is checked. Unchecked by default
- Retention policy (# executions): when checked, the Server keeps the full output only for the most recent number of Task runs. The count covers all Task runs in the Task log, not each Task or Job
- Retention policy (days): when checked, the Server keeps the full output only for Task runs from the last number of days
Lower Max output size only if you are sure that no Task produces more output. A Task whose output grows past the limit stops with an error instead of keeping part of its output.
When the full output of a run falls outside the retention policies, the cleanup cuts it back to Limit output size. The run itself stays in the Task log under the Task log limits. If no retention policy is checked, the full output is kept as long as the run stays in the Task log. Trimming happens in the regular cleanup (see How the limits are applied), not at once.
When you first check a retention policy, VisualCron fills in the matching Task log limit from the Database settings sub tab. While that Task log limit is checked, a retention policy cannot be higher than it:
- If you lower the Task log limit below a retention policy, VisualCron asks whether to lower the retention policy too. If you answer no, the Task log limit is set back.
- If a retention policy is higher than the Task log limit when you click Apply settings, VisualCron lowers it to the limit, shows a message, and leaves the window open so that you can check the values.
Full output can be large, and it is stored in the same log database. With the internal database, which is limited to about 4 GB, use the retention policies to keep full output for a shorter time than the Task log itself.
Move logging to an external database
You can log to an external SQL database instead of the internal database, and copy the existing log data to it.
-
Create a SQL Connection to the external database (see Connection - SQL).
-
On the Database settings sub tab, set Log DB location to "External", select the Connection and, if needed, the Credential, and click Create DB tables.
-
To copy the existing log data, click Copy database.

-
In the Copy Database window, on the Source tab, select where to copy from, for example "Internal". For each log, you can set Copy from and Copy to dates.

-
On the Destination tab, select "External" and the Connection and Credential of the external database. Click Create DB tables if the tables do not exist yet.

-
Click Start copy. The Log tab shows the progress. If you close the window during the copy, the copy continues in the background and you can no longer cancel it.


-
Make sure Log to database is checked and Log DB location is "External", and click Apply settings.

On the Destination tab, Clear all and Recreate table delete the rows of the destination database at once, without asking you to confirm. If Drop all tables is checked there, Create DB tables deletes the existing log tables of the destination first, after you confirm.
Internal database size and cleanup
The internal database is a SQL Server Compact database. Its file can grow to about 4 GB. Not all of that space can be used for data, because the database needs room to work.
When the file is larger than about 3.5 GB at a cleanup, the Server cleans more than the limits ask for. For every log, it keeps at most 80% of the current rows, and it still applies the day limits. If the file has not shrunk by more than 5% after that, the Server compacts the database.
If the file is still not more than 5% smaller after compacting, the Server replaces the internal database with an empty one. Then all Job and Task history, Task output, Audit log entries and other log data in the internal database are lost.
To avoid this, keep the limits low enough that the file stays well below about 3.5 GB, or log to an external database (see Move logging to an external database).
To see that new data is stored, check that new runs appear in the Client's logs.
If the database keeps fewer days than you set although the settings have not changed, the Server now writes more rows a day (for example because there are more Jobs), so the row limits are reached sooner. Raise the row limits, or uncheck them and use only the day limits.
Reset the internal database
If the internal database is full or damaged, and the Server has not already replaced it by itself (see Internal database size and cleanup), you can delete it. The Server then starts with an empty internal database.
Deleting the internal database deletes all Job and Task history, Task output, Audit log entries and other log data in it. Copy the data to an external database first if you need it (see Move logging to an external database).
- On the Server computer, open the Output cache folder. On the Folders tab, Open opens it in Windows Explorer when the Client runs on the Server computer.
- Stop the VisualCron service.
- In the "log" folder, delete the file "VisualCron4.sdf".
- Start the VisualCron service.