Permalink
Browse files

Merge pull request #346 from tompmeyer/find_real_error_log_path

Determine real log_error path.
  • Loading branch information...
2 parents 7f83318 + c45ac09 commit e316b9ac218395c9355fb79ee75ada06f449af58 @jmrenouard jmrenouard committed on GitHub Sep 24, 2017
Showing with 19 additions and 0 deletions.
  1. +19 −0 mysqltuner.pl
View
@@ -1148,7 +1148,26 @@ sub get_basic_passwords {
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 {
+ $myvar{'log_error'} = get_log_file_real_path( $myvar{'log_error'}, $myvar{'hostname'}, $myvar{'datadir'} );
subheaderprint "Log file Recommendations";
infoprint "Log file: "
. $myvar{'log_error'} . "("

0 comments on commit e316b9a

Please sign in to comment.