more logs
[Evergreen.git] / Open-ILS / src / perlmods / OpenILS / WWW / Vandelay.pm
index a65162c..d3fccfa 100644 (file)
@@ -57,7 +57,10 @@ sub spool_marc {
 
        my $auth = $cgi->param('ses') || $cgi->cookie('ses');
 
-       return Apache2::Const::FORBIDDEN unless verify_login($auth);
+       unless(verify_login($auth)) {
+        $logger->error("authentication failed on vandelay record import: $auth");
+           return Apache2::Const::FORBIDDEN;
+    }
 
     my $data_fingerprint = '';
        my $purpose = $cgi->param('purpose');
@@ -78,7 +81,7 @@ sub spool_marc {
         my $outfile = "$dir/$data_fingerprint.mrc";
 
         unless(open(OUTFILE, ">$outfile")) {
-            $logger->error("unable to open MARC file for writing: $@");
+            $logger->error("unable to open MARC file [$outfile] for writing: $@");
                return Apache2::Const::FORBIDDEN;
         }
 
@@ -87,6 +90,7 @@ sub spool_marc {
             if($total_bytes >= $MAX_FILE_SIZE) {
                 close(OUTFILE);
                 unlink $outfile;
+                $logger->error("import exceeded upload size: $MAX_FILE_SIZE");
                    return Apache2::Const::FORBIDDEN;
             }
             print OUTFILE $buf;
@@ -100,6 +104,7 @@ sub spool_marc {
            );
     }
 
+    $logger->info("uploaded MARC batch with key $data_fingerprint");
     $r->content_type('text/plain; charset=utf-8');
        print "$data_fingerprint";
        return Apache2::Const::OK;