summaryrefslogtreecommitdiff
path: root/rt/lib/RT.pm.in
diff options
context:
space:
mode:
authorivan <ivan>2004-11-11 12:13:50 +0000
committerivan <ivan>2004-11-11 12:13:50 +0000
commitc582e92888b4a5553e1b4e5214cf35217e4a0cf0 (patch)
tree3fe7cd7bf22bd356b478f0de0dd8f0b140fcee23 /rt/lib/RT.pm.in
parent289340780927b5bac2c7604d7317c3063c6dd8cc (diff)
import rt 3.0.12
Diffstat (limited to 'rt/lib/RT.pm.in')
-rw-r--r--rt/lib/RT.pm.in23
1 files changed, 12 insertions, 11 deletions
diff --git a/rt/lib/RT.pm.in b/rt/lib/RT.pm.in
index 14c0d47..c0a350a 100644
--- a/rt/lib/RT.pm.in
+++ b/rt/lib/RT.pm.in
@@ -33,7 +33,6 @@ use RT::System;
use vars qw($VERSION $System $SystemUser $Nobody $Handle $Logger
$CORE_CONFIG_FILE
$SITE_CONFIG_FILE
- $VENDOR_CONFIG_FILE
$BasePath
$EtcPath
$VarPath
@@ -94,7 +93,6 @@ $MasonSessionDir = '@MASON_SESSION_PATH@';
=item LoadConfig
Load RT's config file. First, go after the core config file.
-After that, try to load the vendor config.
After that, go after the site config.
=cut
@@ -168,21 +166,23 @@ sub InitLogging {
$RT::Logger=Log::Dispatch->new();
if ($RT::LogToFile) {
-
- unless (-d $RT::LogDir && -w $RT::LogDir) {
- # localizing here would be hard when we don't have a current user yet
- # die $self->loc("Log directory [_1] not found or couldn't be written.\n RT can't run.", $RT::LogDir);
- die ("Log directory $RT::LogDir not found or couldn't be written.\n RT can't run.");
- }
-
- my $filename;
+ my ($filename, $logdir);
if ($RT::LogToFileNamed =~ m![/\\]!) {
# looks like an absolute path.
$filename = $RT::LogToFileNamed;
+ ($logdir) = $RT::LogToFileNamed =~ m!^(.*[/\\])!;
}
else {
$filename = "$RT::LogDir/$RT::LogToFileNamed";
+ $logdir = $RT::LogDir;
}
+
+ unless ( -d $logdir && ( ( -f $filename && -w $filename ) || -w $logdir ) ) {
+ # localizing here would be hard when we don't have a current user yet
+ # die $self->loc("Log directory [_1] not found or couldn't be written.\n RT can't run.", $RT::LogDir);
+ die ("Log file $filename couldn't be written or created.\n RT can't run.");
+ }
+
require Log::Dispatch::File;
@@ -231,7 +231,8 @@ sub InitLogging {
return "$p{message} ($filename:$line)\n"}
},
- stderr => 1
+ stderr => 1,
+ @RT::LogToSyslogConf
));
}