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
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:
For AutoProbe log there is no concept of log rotation.
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
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
create 644 USER USER
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.
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?
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.