Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Small improvement in logrotate cli script
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Jun 23, 2012
1 parent a473fb1 commit 57a99c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/php/rotateperflogs.php
@@ -1,12 +1,11 @@
<?php
/**
* Rotate log files produced by this extension - all logfiles are rotated once NOW, regardless of size
* Munin plugin script
* @author G. Giunta
* @copyright (C) G. Giunta 2012
* @license Licensed under GNU General Public License v2.0. See file license.txt
*
* @todo encapsulate logic into php classes
* @todo add options to allow caller to specify which logs to rotate
* @todo in verbose mode state how many log files were rotated
*/

require 'autoload.php';
Expand Down Expand Up @@ -34,6 +33,8 @@
$logFile = $ini->variable( 'logfileSettings', 'FileName' );
eZPerfLogger::rotateLogs( dirname( $logFile ), basename( $logFile ),
0, $ini->variable( 'logfileSettings', 'MaxLogrotateFiles' ) );
if ( $script->verboseOutputLevel() > 0 )
$cli->output( "Log files rotated" );
}

// csv logs
Expand All @@ -42,11 +43,10 @@
$logFile = $ini->variable( 'csvSettings', 'FileName' );
eZPerfLogger::rotateLogs( dirname( $logFile ), basename( $logFile ),
0, $ini->variable( 'logfileSettings', 'MaxLogrotateFiles' ) );
if ( $script->verboseOutputLevel() > 0 )
$cli->output( "Csv files rotated" );
}

if ( $script->verboseOutputLevel() > 0 )
$cli->output( "Log files rotated" );

$script->shutdown();

?>

0 comments on commit 57a99c9

Please sign in to comment.