better logging

This commit is contained in:
Uwe Steinmann 2023-05-22 10:43:10 +02:00
parent 48c3505c73
commit 1b45b1c1eb
5 changed files with 16 additions and 15 deletions

View File

@ -428,7 +428,7 @@ foreach($file_ary as $file) {
}
}
add_log_line("?name=".$name."&folderid=".$folderid);
add_log_line("add document ".$document->getId()." in folder ".$folder->getId());
}
header("Location:../out/out.ViewFolder.php?folderid=".$folderid."&showtree=".$_POST["showtree"]);

View File

@ -123,7 +123,7 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){
}
}
add_log_line("?name=".$name."&documentid=".$documentid);
add_log_line("add file '".$name."' to document ".$documentid);
header("Location:../out/out.ViewDocument.php?documentid=".$documentid."&currenttab=attachments");

View File

@ -306,7 +306,7 @@ switch($command) {
}
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_move_folder'), 'data'=>''));
add_log_line();
add_log_line("move folder ".$mfolder->getId()." to ".$folder->getId());
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>'Error moving folder', 'data'=>''));
@ -352,7 +352,7 @@ switch($command) {
}
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_move_document'), 'data'=>''));
add_log_line();
add_log_line("move document ".$mdocument->getId()." to folder ".$folder->getId());
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>'Error moving document', 'data'=>''));
@ -395,7 +395,7 @@ switch($command) {
if($mdocument->remove()) {
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_transfer_content'), 'data'=>''));
add_log_line();
add_log_line("transfer content of document ".$mdocument->getId()." to document ".$targetdoc->getId());
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>'Error removing source document', 'data'=>''));
@ -442,7 +442,7 @@ switch($command) {
if($targetdoc->addDocumentLink($mdocument->getID(), $user->getID(), false)) {
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_link_document'), 'data'=>''));
add_log_line();
add_log_line("link document ".$mdocument->getId()." to ".$targetdoc->getId());
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>'Error linking document', 'data'=>''));
@ -499,7 +499,7 @@ switch($command) {
}
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_folder_deleted'), 'data'=>''));
add_log_line();
add_log_line("delete folder ".$folder->getId());
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>getMLText('error_remove_folder'), 'data'=>''));
@ -544,7 +544,7 @@ switch($command) {
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_deleted'), 'data'=>''));
add_log_line();
add_log_line("delete document ".$document->getId());
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>getMLText('error_remove_document')."<br />".getMLText($controller->getErrorMsg()), 'data'=>''));
@ -576,6 +576,7 @@ switch($command) {
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_unlocked'), 'data'=>''));
add_log_line("unlock document ".$document->getId());
}
} else {
header('Content-Type: application/json');
@ -588,7 +589,7 @@ switch($command) {
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_locked'), 'data'=>''));
add_log_line();
add_log_line("lock document ".$document->getId());
}
}
} else {
@ -622,7 +623,7 @@ switch($command) {
}
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_name_changed'), 'data'=>''));
add_log_line();
add_log_line("set name '".$_REQUEST['name']."' of document ".$document->getId());
}
} else {
header('Content-Type: application/json');
@ -653,7 +654,7 @@ switch($command) {
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_mimetype_changed'), 'data'=>''));
add_log_line();
add_log_line("set mimetype '".$realmimetype."' of document ".$document->getId().":".$content->getVersion());
}
} else {
header('Content-Type: application/json');
@ -868,7 +869,7 @@ switch($command) {
}
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_added'), 'data'=>$document->getID()));
add_log_line();
add_log_line("add document ".$document->getId()." in folder ".$folder->getId());
} else {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
@ -947,7 +948,7 @@ switch($command) {
}
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_added'), 'data'=>$document->getID()));
add_log_line();
add_log_line("add file '".$name."' to document ".$document->getId());
}
} else {
header('Content-Type: application/json');

View File

@ -95,7 +95,7 @@ if ($notifier){
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_document')));
add_log_line("?documentid=".$documentid);
add_log_line("delete document ".$documentid);
header("Location:../out/out.ViewFolder.php?folderid=".$folder->getID());

View File

@ -344,7 +344,7 @@ default:
}
}
add_log_line("?documentid=".$documentid);
add_log_line("update document ".$documentid." with version ".$content->getVersion());
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
?>