import rt 3.0.12
[freeside.git] / rt / lib / RT.pm.in
index 14c0d47..c0a350a 100644 (file)
@@ -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
                     ));
     }