There are few cases where the amount of log information becomes so huge that they are impossible to handle. For that reason, we can configure the logfiles to rotate size-based, time-based, or both.
Getting ready…
This recipe can be considered as a fine-tune addition to the Logging to a custom file recipe. We will simply expand on this recipe by adding rotation capabilities to our custom logfile.
How to do it…
We can define the rotation logfile by logging in to the Oracle Enterprise Manager Console and then right-clicking on the soa-infra node. Then, select Logs and Log Configuration. In the Log Configuration window, select the logfile definition and click on the EditConfiguration… button as shown in the following screenshot:
In the Edit Log File window, we define the rotation policy for the selected logfile as shown in the following screenshot:
Click on the OK button to confirm the changes. There is no need to restart the Oracle SOA Suite server for changes to take effect.
How it works…
We have the following two types of rotation policies, which can also be combined:
Size based: In this rotation policy, we define the maximum size of a single logfile. We can also define the maximum size of all logfiles in the rotation. For example, if we set the maximum size of a single logfile to 10 MB and the maximum size of all the logfiles in the rotation to 100 MB, we will have a maximum of 10 files with the size of 10 MB in rotation. When the logfile size reaches the maximum, the oldest log information gets deleted, thus providing new logging space.
Time based: In this rotation policy, we have two important options. The first one is frequency, where we define at what time periods new logfiles will be created every hour. If we set frequency to Hourly, a new logfile will be created. Another option is retention period, where we define how long the logfiles are kept before they are purged. If we set the option to Day, one-day-old logfiles will be purged every day.
Tip
Although both the preceding options can be mixed in configuration, it is advisable to choose only one of them to avoid unexpected logging behavior.
See also
For information on how to set up the custom logfile, refer to the Logging to a custom file recipe.