some cleanup and docs for the new logging system

This commit is contained in:
JT Smith 2005-04-01 05:10:53 +00:00
parent 6aa9f76a71
commit 2c145c0d22
6 changed files with 32 additions and 17 deletions

View file

@ -13,8 +13,8 @@ save you many hours of grief.
to be installed on your system manually. You can optionally
just use the WebGUI runtime environment to save yourself
the hassle of downloading all of them. You can also install
them using testEnvironment.pl --install-modules
The new modules you'll need to install are:
them using testEnvironment.pl The new modules you'll need
to install are:
Net::LDAP
Date::Manip
@ -23,14 +23,17 @@ save you many hours of grief.
HTML::TagFilter
HTML::Template
Parse::PlainConfig
HTTP::BrowserDetect
Parse::RecDescent
Text::Balanced
Tie::IxHash
Tie::CPHash
XML::RSSLite
XML::Simple
* After upgrading you'll need to create a log.conf file in your etc
folder for the new logger. For most situations you can just copy
log.conf.original to log.conf and you'll be fine. If you want
to set up custom logging rules, see this web page:
http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/Config.html
6.5.0
--------------------------------------------------------------------

View file

@ -349,3 +349,10 @@ In 6.3 the template system has been replaced in favor of the new template
asset. Please see WebGUI::Asset::Template for details.
5.17 WebGUI::ErrorHandler API Changed
In 6.6 we brought log4perl to bear on our debuging and logging needs. This had
a slight impact on the WebGUI::ErrorHandler API. Although there are many
changes, the only thing anyone should notice is that fatalError() was renamed
to fatal().

View file

@ -23,6 +23,20 @@ print "\tDeleting old templates\n" unless ($quiet);
my $asset = WebGUI::Asset->newByDynamicClass("PBtmpl0000000000000035");
$asset->purge;
#--------------------------------------------
print "\tUpdating config file.\n" unless ($quiet);
my $pathToConfig = '../../etc/'.$configFile;
my $conf = Parse::PlainConfig->new('DELIM' => '=', 'FILE' => $pathToConfig, 'PURGE'=>1);
my %newConfig;
foreach my $key ($conf->directives) {
unless ($key eq "logfile" || $key eq "passwordChangeLoggingEnabled" || $key eq "emailRecoveryLoggingEnabled") {
$newConfig{$key} = $conf->get($key);
}
}
$conf->purge;
$conf->set(%newConfig);
$conf->write;
WebGUI::Session::close();

View file

@ -28,8 +28,6 @@ dsn = DBI:mysql:www_example_com
dbuser = webgui
dbpass = password
logfile = /var/log/webgui.log
extrasURL = /extras
extrasPath = /data/WebGUI/www/extras
@ -44,9 +42,6 @@ templateCacheType=file
passiveProfileInterval = 86400 # in seconds
emailRecoveryLoggingEnabled = 1
passwordChangeLoggingEnabled = 1
paymentPlugins = ITransact
authMethods = LDAP, WebGUI

View file

@ -1,6 +1,6 @@
log4perl.logger = DEBUG, mainlog
log4perl.appender.mainlog = Log::Log4perl::Appender::File
log4perl.appender.mainlog.filename = /var/log/webguitest.log
log4perl.appender.mainlog.filename = /var/log/webgui.log
log4perl.appender.mainlog.layout = PatternLayout
log4perl.appender.mainlog.layout.ConversionPattern = %d - %p - %c - %M[%L] - %m%n

View file

@ -67,9 +67,7 @@ sub _isValidPassword {
=cut
sub _logSecurityMessage {
if($session{config}{passwordChangeLoggingEnabled}) {
WebGUI::ErrorHandler::security("change password. Password changed successfully");
}
WebGUI::ErrorHandler::security("change password. Password changed successfully");
}
#-------------------------------------------------------------------
@ -535,9 +533,7 @@ sub recoverPasswordFinish {
$encryptedPassword = Digest::MD5::md5_base64($password);
$self->saveParams($userId,"WebGUI",{identifier=>$encryptedPassword});
_logSecurityMessage();
if($session{config}{emailRecoveryLoggingEnabled}) {
WebGUI::ErrorHandler::security("recover a password. Password emailed to: ".$session{form}{email});
}
WebGUI::ErrorHandler::security("recover a password. Password emailed to: ".$session{form}{email});
$message = $session{setting}{webguiRecoverPasswordEmail};
$message .= "\n".WebGUI::International::get(50).": ".$username."\n";
$message .= WebGUI::International::get(51).": ".$password."\n";