By default, Enterprise Server rotates a node agent's log file when the size of file exceeds a specified limit. This limit is set by the value of the log-rotation-limit-in-bytes attribute of the node agent's log-service element.
When you set an interval for rotating a node agent's log file, Enterprise Server rotates the log file periodically, regardless of the file's size.
To prevent unnecessary rotations of the log file, Enterprise Server determines whether to rotate the log file as follows:
After the specified interval has elapsed, Enterprise Server rotates the log file the next time logging activity occurs, for example:
The node agent is restarted.
Log levels are changed.
The log file is written to.
If no logging activity occurs during the interval, Enterprise Server does not rotate the log file.
asadmin> set domain.node-agent.node-agent-name.log-service.log-rotation-timelimit-in-minutes=interval
The name of the node agent for which you are setting the interval for rotating the log file.
A positive integer that specifies the required interval in minutes.
Note - If interval is 0, Enterprise Server rotates the node agent's log file on the basis of the file's size, not periodically.
Example 2-1 Setting the Interval for Rotating a Node Agent's Log File
This example sets the interval for rotating the log file of the node agent n1 to one hour.
asadmin> set domain.node-agent.n1.log-service.log-rotation-timelimit-in-minutes=60 domain.node-agent.n1.log-service.log-rotation-timelimit-in-minutes = 60