Skip to content

Commit a624786

Browse files
committed
Update documentation for and templates for PROJECT and INSTANCE logging
1 parent 4ba12c0 commit a624786

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

man/set_project_instance.Rd

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rcc.log.db/schema/rcc_job_log.sql

+4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
CREATE TABLE `rcc_job_log` (
22
`id` bigint NOT NULL AUTO_INCREMENT,
33
`log_date` datetime NOT NULL,
4+
`project` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
5+
`instance` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
46
`script_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
57
`script_run_time` datetime NOT NULL,
68
`job_summary_data` mediumtext DEFAULT NULL,
79
`job_duration` double not null,
810
`level` enum('SUCCESS','DEBUG','ERROR') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
911
PRIMARY KEY (`id`),
1012
KEY `log_date` (`log_date`),
13+
KEY `project` (`project`),
14+
KEY `instance` (`instance`),
1115
KEY `script_name` (`script_name`),
1216
KEY `script_run_time` (`script_run_time`),
1317
KEY `level` (`level`)

study_template/example.env

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
PROJECT=study_template
12
INSTANCE=Development
23
TIME_ZONE=America/New_York
34

vignettes/custom_rscript.Rmd

+5-2
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ If this is not your first REDCap Custodian rodeo, you might remember what you ne
5353
You'll need to talk to at least a REDCap or a MySQL database. You will probably want both. Rename the `example.env` to `testing.env` and configure it for development on your computer. That file is composed of five sections.
5454

5555
```sh
56+
PROJECT=study_template
5657
INSTANCE=Development
5758
TIME_ZONE=America/New_York
5859
```
5960

60-
`INSTANCE` names the REDCap system or _instance_ you'll be talking to. This file assumes you are talking to only one REDCap in your script. There are other tools for multiple-instances.
61+
`PROJECT` names the project, study, or git repository that owns the scripts. This is useful when reading log data from a shared log database. A unique value in the PROJECT field allows you to identify log entries specific to a project.
6162

62-
`TIME_ZONE` should be the local timezone of your REDCap instance. Note that REDCap time facts in local time. The MariaDB driver and the Lubridate library default to UTC. That can get complicated. Be careful with time. For more details see [`stupid_date_tricks.R`](https://gist.github.com/pbchase/ed55ab5dacbcc5d8a702a9cb935cccb5)
63+
`INSTANCE` names the _instance_ or a project, study, or REDCap system. If scripts are deployed in development, testing, and production, a unique value in this field allows you to identify log entries from different deployments.
64+
65+
`TIME_ZONE` should be the local timezone of your REDCap instance. Note that REDCap records time facts in local time. The MariaDB driver and the Lubridate library default to UTC. That can get complicated. Be careful with time. For more details see [`stupid_date_tricks.R`](https://gist.github.com/pbchase/ed55ab5dacbcc5d8a702a9cb935cccb5)
6366

6467
```sh
6568
# Email config

0 commit comments

Comments
 (0)