DX Application Performance Management

 View Only
  • 1.  Agent Log Rotation Implementation

    Posted Aug 06, 2014 09:08 AM

    Our environment: CA Introscope with .NET agent version 9.5.3.

    Is it possible to implement logs rotation for the agents?

    If yes, what are the parameters we should setup for that purpose?

    Thanks in advance



  • 2.  Re: Agent Log Rotation Implementation
    Best Answer

    Broadcom Employee
    Posted Aug 06, 2014 09:31 AM

     

    Hi

     

    The introscopeAgent log rotation is already configured for both Java and .NET agents.

     

    For .NET, you need to check in the file logging.config.xml in the wily folder where all the pbds are.

     

    These are the main parameters to review:

     

     

     

    <maxSizeRollBackups value="4" />

     

    <maximumFileSize value="200MB" />

     

     

     

    They show that the log file will rollover when it gets to 200MB and it will do that four times, so including the file you are writing to already you basically get 1GB of logging data before the agent starts writing data again.

    This will also be one log for every application the .NET application is monitoring, and it's common to see multiple applications in the same .NET install.

     

    By modifying these values you can get the log to rollover more often as required.

     

     

     

    There is some extra information on the log4net library that we are using here:

     

    http://logging.apache.org/log4net/release/manual/configuration.html

     

     

     

    For AutoProbe log there is no concept of log rotation.

     

     

     

    Many thanks,

     

    David Lewis

     



  • 3.  Re: Agent Log Rotation Implementation

    Posted Aug 07, 2014 08:58 AM

    Hi David,

    We have the exact default setup in logging.config.xml but it looks like it is not behaving as expected.

    The logs keeps growing without rotating



  • 4.  Re: Agent Log Rotation Implementation

    Posted Aug 07, 2014 03:38 PM

    Hi,

     

    As suggested by David, you can use the in-built feature provided by Wily to rotate your logs.

     

    Apart from that, if your EM\MOM is running on a UNIX\Linux servers, you can utilize the logrotate command utility.

     

    For e.g., you can have below sample code appended to your -  /etc/logrotate.d/USER file

     

    Location_of_your_LOGFILE {

         weekly

         size 15M

         create 644 USER USER

         rotate 4

    }

     

    This code will rotate the logs weekly ( or if some daily crons are running which checks size limit, rotates before the week if reached 15MB ) with 4 in count.

    Here USER represents the user having access to that particular file.

     

    Note that this change can be done by the Root user only in the logrotate.d file.

     

    Let me know if needs more clarification.

     

    Regards,

    Vaibhav



  • 5.  Re: Agent Log Rotation Implementation

    Posted Aug 10, 2014 02:21 AM

    It appears that the logging rotation works as expected.

    However, it looks like some temporary logs are not being cleaned up. The logs shows the following messages:

    Renaming the Introscope Agent log file from C:\Program Files\CA APM\Introscope\wily\logs\IntroscopeAgent.20140809-143411.log to C:\Program Files\CA APM\Introscope\wily\logs\IntroscopeAgent.SamisWSProd.log did not succeed. 

    The Introscope Agent will continue logging to the original log file.

    As a result, the files IntroscopeAgent.2014xxxx-******.log remains in the log directory and after a while, takes the whole disk space.

     

    Any ideas how this can be solved?



  • 6.  Re: Agent Log Rotation Implementation

    Posted Aug 10, 2014 08:13 AM

    Hi,

     

    I haven't faced this sort of issue ever, but can you please check whether its something related to user permission issue ?

     

    To test the same, try to create some random log file manually in the same path with the same user ( through which is agent is been running ) and see does it allow to do so.

     

    Regards,

    vaibhav