-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item8668: Item12022: Improve Compatibility logger
The PlainFile logger has serious performance issues when rotating very large log files on busy systems. This checkin makes it easier to choose the Compatibility logger: - Restore the LogFileName, DebugFileName and WarningFileName settings to Foswiki.spec. Default is empty, so they are not used on new installations. - Add checkers for these settings. Note that they are deprecated, and should be removed unless the Compatibility logger is desired. - Add a note that PlainFile logger has a performance issue at end of month, when rotating very large files on busy systems. - Note that old TWiki extensions might wite directly to the LogFileName. This also partially solves the issue of upgraders being asked to manually edit LocalSite.cfg to remove the obsolete settings. Conflicts: core/lib/Foswiki.spec git-svn-id: http://svn.foswiki.org/branches/Release01x01@15622 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information
GeorgeClark
authored and
GeorgeClark
committed
Oct 17, 2012
1 parent
f98c5e0
commit ee63881
Showing
6 changed files
with
220 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# See bottom of file for license and copyright information | ||
package Foswiki::Configure::Checkers::DebugFileName; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Foswiki::Configure::Checker (); | ||
our @ISA = ('Foswiki::Configure::Checker'); | ||
|
||
use Foswiki::Configure::Load (); | ||
|
||
sub check { | ||
my $this = shift; | ||
my $mess = ''; | ||
|
||
if ( $Foswiki::cfg{DebugFileName} ) { | ||
$mess .= $this->WARN( | ||
'This setting is deprecated. Delete it unless you want to use the CompatibilityLogger' | ||
); | ||
$mess .= $this->showExpandedValue( $Foswiki::cfg{DebugFileName} ); | ||
} | ||
else { | ||
if ( $Foswiki::cfg{Log}{Implementation} eq | ||
'Foswiki::Logger::Compatibility' ) | ||
{ | ||
$mess .= $this->WARN( | ||
'This setting is recommended for the CompatibilityLogger. If not set, logs are written to <code>$Foswiki::cfg{DataDir}/debug%DATE%.txt</code>' | ||
); | ||
$mess .= $this->NOTE( | ||
'Foswiki 1.0.x configuration default was <code>$Foswiki::cfg{DataDir}/debug.txt</code>' | ||
); | ||
} | ||
} | ||
|
||
return $mess; | ||
} | ||
|
||
1; | ||
__END__ | ||
Foswiki - The Free and Open Source Wiki, http://foswiki.org/ | ||
Copyright (C) 2008-2012 Foswiki Contributors. Foswiki Contributors | ||
are listed in the AUTHORS file in the root of this distribution. | ||
NOTE: Please extend that file, not this notice. | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. For | ||
more details read LICENSE in the root of this distribution. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
As per the GPL, removal of this notice is prohibited. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# See bottom of file for license and copyright information | ||
package Foswiki::Configure::Checkers::LogFileName; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Foswiki::Configure::Checker (); | ||
our @ISA = ('Foswiki::Configure::Checker'); | ||
|
||
use Foswiki::Configure::Load (); | ||
|
||
sub check { | ||
my $this = shift; | ||
my $mess = ''; | ||
unless ( | ||
$Foswiki::cfg{Log}{Implementation} eq 'Foswiki::Logger::Compatibility' ) | ||
{ | ||
|
||
$mess .= $this->NOTE( <<NOTE ); | ||
This setting might be used by old plugins that have not been migrated to the Foswiki API. | ||
If not provided, Foswik core will provide a default setting of <code>$Foswiki::cfg{Log}{Dir}/event.log</code>. | ||
NOTE | ||
my $logger = $Foswiki::cfg{Log}{Implementation}; | ||
$logger =~ s/Foswiki::Logger:://; | ||
$mess .= $this->NOTE("It is not used by the $logger logger."); | ||
} | ||
if ( $Foswiki::cfg{LogFileName} ) { | ||
$mess .= $this->showExpandedValue( $Foswiki::cfg{LogFileName} ); | ||
} | ||
else { | ||
if ( $Foswiki::cfg{Log}{Implementation} eq | ||
'Foswiki::Logger::Compatibility' ) | ||
{ | ||
$mess .= $this->WARN( | ||
'This setting is recommended for the CompatibilityLogger. If not set, logs are written to <code>$Foswiki::cfg{DataDir}/log%DATE%.txt</code>' | ||
); | ||
} | ||
} | ||
|
||
return $mess; | ||
} | ||
|
||
1; | ||
__END__ | ||
Foswiki - The Free and Open Source Wiki, http://foswiki.org/ | ||
Copyright (C) 2008-2012 Foswiki Contributors. Foswiki Contributors | ||
are listed in the AUTHORS file in the root of this distribution. | ||
NOTE: Please extend that file, not this notice. | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. For | ||
more details read LICENSE in the root of this distribution. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
As per the GPL, removal of this notice is prohibited. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# See bottom of file for license and copyright information | ||
package Foswiki::Configure::Checkers::WarningFileName; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Foswiki::Configure::Checker (); | ||
our @ISA = ('Foswiki::Configure::Checker'); | ||
|
||
use Foswiki::Configure::Load (); | ||
|
||
sub check { | ||
my $this = shift; | ||
my $mess = ''; | ||
|
||
if ( $Foswiki::cfg{WarningFileName} ) { | ||
$mess .= $this->NOTE( | ||
'This setting is deprecated. Delete it unless you want to use the CompatibilityLogger' | ||
); | ||
$mess .= $this->showExpandedValue( $Foswiki::cfg{WarningFileName} ); | ||
} | ||
else { | ||
if ( $Foswiki::cfg{Log}{Implementation} eq | ||
'Foswiki::Logger::Compatibility' ) | ||
{ | ||
$mess .= $this->WARN( | ||
'This setting is recommended for the CompatibilityLogger. If not set, logs are written to <code>$Foswiki::cfg{DataDir}/warn%DATE%.txt</code>' | ||
); | ||
} | ||
} | ||
|
||
return $mess; | ||
} | ||
|
||
1; | ||
__END__ | ||
Foswiki - The Free and Open Source Wiki, http://foswiki.org/ | ||
Copyright (C) 2008-2012 Foswiki Contributors. Foswiki Contributors | ||
are listed in the AUTHORS file in the root of this distribution. | ||
NOTE: Please extend that file, not this notice. | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. For | ||
more details read LICENSE in the root of this distribution. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
As per the GPL, removal of this notice is prohibited. |