Controlling the number of files in the log directory
Is there something which is supposed to manage the size of the log directory (C:\Program Files\Hewlett-Packard\HP Operations Orchestration\central\var\logs\)? In particular there are localhost_access_log files going back to when the console was originally installed.
I don't think there is anything, But you could create a batch file and schedule it.
A command like this in the batch file should do it
forfiles /p "C:\Program Files\Hewlett-Packard\HP Operations Orchestration\central\var\logs" /m *.log /d -180 /c "cmd /c IF @isdir == FALSE del @file"
The -d is number of days so that command should delete files > 180 days old.
Right, I probably already have a script I can reuse from previous projects. I just wanted to make sure there wasn't some existing feature within the product that I wasn't aware of.
Well I said I don't think so, BUT I'm still to upgrade to HPOO 10.xx.
However I've had to create things like this for application logging well before now so it is more my assumption.
You have the log4j.properties under the central/conf folder
For the access logs you also have the tomcat's server.xml under central/tomcat/conf where I suggest you should look for entry like below; I also suggest consulting tomcat's documentation around controlling the valve.
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
Hope it helps,
The log4j.properties are very straight forward.
Reviewing the AccessLog valve documentation I see how you can control the rotation frequency using fileDateFormat. However I don't see anything for removing older logs, similar to MaxBackupIndex in log4j.
Most of the Google searches seems to point at needing to run a scheduled command, or in this cases perhaps a scheduled OO flow.
Here is the link to the AccessLog valve documentation I found:
You are right.
You could have Terry's approach for Windows to control the cleanup; of course you could wrap it in an OO flow.