Respected Contributor.. Paul Meaders Respected Contributor..
Respected Contributor..
628 views

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.

Thanks

Paul

 

Labels (1)
0 Likes
6 Replies
Established Member.. TerrySummers
Established Member..

Re: Controlling the number of files in the log directory

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.

 

0 Likes
Respected Contributor.. Paul Meaders Respected Contributor..
Respected Contributor..

Re: Controlling the number of files in the log directory

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.

Paul

0 Likes
Established Member.. TerrySummers
Established Member..

Re: Controlling the number of files in the log directory

Hi Paul,

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.

0 Likes
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Controlling the number of files in the log directory

Hi,

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" -->
<Valve className="org.apache.catalina.valves.AccessLogValve"

Hope it helps,

Andrei Vasile Truta
0 Likes
Respected Contributor.. Paul Meaders Respected Contributor..
Respected Contributor..

Re: Controlling the number of files in the log directory

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:
https://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Access_Log_Valve

Thanks

 

 

0 Likes
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Controlling the number of files in the log directory

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.

Andrei Vasile Truta
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.