Merge pull request #346 from tompmeyer/find_real_error_log_path

Determine real log_error path.
This commit is contained in:
Jean-Marie Renouard 2017-09-24 23:33:37 +02:00 committed by GitHub
commit e316b9ac21

View file

@ -1148,7 +1148,26 @@ sub get_basic_passwords {
return get_file_contents(shift); return get_file_contents(shift);
} }
sub get_log_file_real_path {
my $file = shift;
my $hostname = shift;
my $datadir = shift;
if ( -f "$file" ) {
return $file;
}
elsif ( -f "$hostname.err" ) {
return "$hostname.err"
}
elsif ( $datadir ne "" ) {
return "$datadir$hostname.err";
}
else {
return $file;
}
}
sub log_file_recommandations { sub log_file_recommandations {
$myvar{'log_error'} = get_log_file_real_path( $myvar{'log_error'}, $myvar{'hostname'}, $myvar{'datadir'} );
subheaderprint "Log file Recommendations"; subheaderprint "Log file Recommendations";
infoprint "Log file: " infoprint "Log file: "
. $myvar{'log_error'} . "(" . $myvar{'log_error'} . "("