GlassFish Performance Advisor - Managing Rotated Log Files

In this blog, I would like to talk about setting up and using the log rotation management features of the GlassFish Performance Advisor.

The GlassFish application server allows users to configure the logger settings in such a way that the server would automatically rotate log files, when certain user-configurable conditions are met. This typically happens when the log file exceeds a certain size. Over a period of time, you could end up with a number of rotated log files. The Log Rotation Manager feature of the Performance Advisor lets you manage the rotated log files.

To set up the Log Rotation Manager, click on the Performance Advisor->Management Rules->Log Rotation Manager node on the admin console. This is how the screen to set up the Log Rotation Manager looks like :



Rotated Log Management

In the above screen you can specify whether you want to move the rotated log files to a different directory(typically, for archiving) or delete the files. The Rotation Policy can be one of the three options : Number Of Files, Size or Time. I'll explain these 3 options below.

Number Of Files : When you select this option, the Log Rotation Manager will periodically check the log directory and if the number of log files exceeds the user configured number of files, the log files are either delete or moved to a different directory. So for example, if you chose the "NumberOfFiles" rotation policy option and set the NumberOfFiles to 3, the server will move or delete rotated files, when their number exceeds 3, so there are no more than 3 rotated log files in the log directory.

Size : When you select this option, the Log Rotation Manager will periodically check the log directory and if the total size of log files exceeds the user configured size, the log files are either delete or moved to a different directory. So for example, if you chose the "Size" rotation policy option and set the Size limit to 100 MB, the server will move or delete rotated files, when their total size exceeds 100MB, so the total size of rotated log files does not exceed 100 MB.

Time : When you select this option, the Log Rotation Manager will periodically check the log directory and if there are any files older than the specified time, they are moved or deleted.

The Log Rotation Manager can be setup on any instance or cluster. From the admingui, all you need to do is select the list of targets for which you want set this rule up and the rest will be taken care of by the Performance Advisor.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

sirajg

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today