Why are there so many log tables (oslog_Screen_1, _2, etc...) in the database?

Log tables save large amounts of data and can fill up fairly quickly. To avoid scalability issues with a database that continues to grow uninterruptedly, these tables use a cycling pattern. This means that every week the Log Service will start writing to a different log table, and the oldest table of a specific cycle period (defined in the OutSystems Configuration Tool) will be cleaned up. There are 10 log tables for each kind of log type (screen, error, timer, general, sms, web references, and web services) and each one will hold at most 1 week worth of data.

Let me try to illustrate this with an example: Imagine that the logger service is writing screen logs to the oslog_Screen_7 table. You would be able to see this because the oslog_Screen view is pointing to that table. On Saturday, at midnight, the cycle rotates and it starts writing to the oslog_Screen_8 table. In OutSystems Service Center you’ll notice that there will be no logs in the monitoring screens. Because the cycle period is set to 4 weeks, the table oslog_Screen_4, the oldest one that is still holding data, will be truncated. You’ll have 4 weeks of saved logs, although you’ll only see 1 week in OutSystems Service Center.

You can use your database backup and data transformation mechanisms if you want to consolidate or save these logs, but you need to be careful with scalability issues.

If you need to persist business level auditing information, you have the option to use the Auditing Solution that implements its own auditing services.

You can also read more on logs and performance counters in this troubleshooting document.

Hope this helps,
Tiago Simões
Whats the easiest way to clear the logs??
Julius -

1. Sugestion: start a new topic for questions in the future, instead of jumping onto a "tips" post.

2. Easiest way to clear the logs it to run a TRUNCATE command in the DB (that won't fill the transaction log, at least not in SQL Server, I don't know about Oracle).

3. Why do you want to clear the logs? If it is to save space, perhaps you need to adjust your log retention period with the Configuration Tool.