Viewing the logs

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

You can view these logs by using:

more <filename>

e.g.

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:

rm *-*

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

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.

tail -n 0 -f *

This will create output that looks like:

==> 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":"org.obiba.opal.web.security.AuditInterceptor","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":"org.obiba.opal.web.security.AuditInterceptor","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":"org.obiba.opal.web.security.AuditInterceptor","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/127.0.0.1, localhost/127.0.1.1, 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/127.0.0.1, localhost/127.0.1.1, 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:

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.