-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function to export logfile #383
Conversation
@joundso, thanks for adding this. Our server update has hit some snags and we're still not to the version that supports that API call. Once that happens, we'll need to add tests, and then I'll pull it into the main branch. |
We've upgraded the server and I'm trying this function. Thanks again for writing it in February. I tried a few projects and they crashed because the returned size was too big. It worked fine once I limited the size (eg, by date). I'm guessing this is typical for most serious projects --the kind of projects where people care enough to monitor the logs. Are you willing to implement some of the parameters that limit the returned set/ I'm thinking the most important are Ideally REDCapR catches the error and suggests something useful (for example, I wrote this yesterday for large records.) The types of errors fell into these two buckets: The first gives a 504 code. The second was something else. Also, will you please change the function name from I'm happy to change it myself, but I kinda like how the whole file in GitHub shows who added the lines. After I renamed the file of your last function ( > uri <- "https://bbmc.ouhsc.edu/redcap/api/"
> token <- "9A81268476645C4E5F03428B8AC3AA7B"
> REDCapR::redcap_export_logging(redcap_uri=uri, token=token)$data
The REDCapR read/export operation was not successful. The error message was:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>504 Gateway Timeout</title>
</head><body>
<h1>Gateway Timeout</h1>
<p>The gateway did not receive a timely response
from the upstream server or application.</p>
</body></html> > uri <- "https://bbmc.ouhsc.edu/redcap/api/"
> token <- "BB0D01A2FC524993E42D6104236B1715"
> REDCapR::redcap_export_logging(redcap_uri=uri, token=token)$data
The REDCapR read/export operation was not successful. The error message was:
<div class="red" style="margin:20px 0px;max-width:700px;">
<b>REDCap crashed due to an unexpected PHP fatal error!</b><br><br>
<b>Error message:</b> Allowed memory size of 2147483648 bytes exhausted (tried to allocate 142066968 bytes)<br>
<b>File:</b> redcap_v12.5.2/Config/init_functions.php<br>
<b>Line:</b> 4051<br>
</div>
ERROR: REDCap ran out of server memory. The request cannot be processed. Please try importing/exporting a smaller amount of data.
data frame with 0 columns and 0 rows |
It's a pain to update & redeploy & rebase every time the server is updated.
@joundso, I made those changes I suggested above. Thanks for starting the function and doing the hard work! |
Maybe fix #320