Inspecting the Opal server and DataSHIELD logs

Viewing the logs

If you wish to look at the Opal server or DataSHIELD logs:

  • Launch the virtual machine

  • Log into the console window for the Virtual Machine using the options found here – it would be advisable in this case to use the Ubuntu Terminal/Shell environment as it offers better funtionality of scrolling through the code compared to the virtual machine’s window.

  • Change to directory"/var/log/opal" 

    1 cd /var/log/opal


  • List the contents using:

    1 ls -lt

    (the "-lt" part of the command instructs it to list in order of most recent change).

  • The directory contains four log files: 

    • datashield.log

    • opal.log

    • rest.log

    • stdout.log

You can view these logs by using:

1 more <filename>


1 more stdout.log

Given these logs will likely be very long, you can hit space to see more, and q to quit.

Live Monitoring Logs

If you wish to create a blank slate to view what logs are created as you try to recreate a problem on the opal server, you can clear out the logs using the following steps.

If you want to see the logs from a previous error, don't proceed with this clearing process.

Firstly, delete anything with a hyphen in the file name:

1 rm *-*

Then remove the existing contents of the four remaining files (effectively the same as deleting the contents of them).

1 cat < /dev/null> datashield.log > opal.log > rest.log > stdout.log

Now that these are blank, you can give a command that will list the changes of all the commands that are output: using the * at the end.

1 tail -n 0 -f *

This will create output that looks like:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ==> datashield.log <== ==> opal.log <== ==> rest.log <== ==> stdout.log <== ==> rest.log <== {"@timestamp":"2020-03-12T07:42:57.006-07:00","@version":1,"message":"/files/_meta/home/administrator/testdata/TESTING_GROUP","logger_name":"","thread_name":"qtp872452937-133","level":"WARN","level_value":30000,"HOSTNAME":"localhost","method":"GET","created":"/datasource/776f8442-cfdc-45b8-a96d-fac6b3c63c6b","username":"Unknown","status":"401"} {"@timestamp":"2020-03-12T07:42:57.738-07:00","@version":1,"message":"/system/name","logger_name":"","thread_name":"qtp872452937-147","level":"INFO","level_value":20000,"HOSTNAME":"localhost","method":"GET","created":"/shell/command/1","username":"Unknown","status":"200"} {"@timestamp":"2020-03-12T07:42:57.746-07:00","@version":1,"message":"/auth/providers","logger_name":"","thread_name":"qtp872452937-133","level":"INFO","level_value":20000,"HOSTNAME":"localhost","method":"GET","created":"/datasource/776f8442-cfdc-45b8-a96d-fac6b3c63c6b","username":"Unknown","status":"200"} ==> stdout.log <== 2020-03-12 07:43:08,687 ERROR org.obiba.shiro.realm.ObibaRealm - Connection failure with identification server: [I/O error on POST request for "https://localhost:8444/ws/tickets": Connect to localhost:8444 [localhost/, localhost/, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused); nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:8444 [localhost/, localhost/, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)]

If you are interested in only one file, say stdout.log, the command will be:

1 tail -n 0 -f stdout.log

The advantage of this method is it is all in one line . The disadvantage is that the outputs can’t be scrolled through to find where the problem first started, if a large log is produced.