This article explains how to set up the Runtime to write Session logs into a chosen RDBMS database, different than the default H2 database.
First, stop your Runtime, and then follow the steps below.
Configure the parameters of the database
There are samples of configurations files for RDBMS in the <runtimeDirectory>/properties/logs/samples
Copy/Paste the one corresponding to yours in <runtimeDirectory>/properties/logs/
Example for mysql:
- The most common parameters to change are surrounded here, but you can too modify the others to your needs.
- If you are using a database which is not in the samples, you can take example on one of them and adapt it to your database. In this case, feel free to send your modified file to the Support, they will check it and may add it to the samples in the next Runtime release.
- You can set the clear password in the userLogRdbmsPassword parameter, or set the encrypted password in the userLogRdbmsEncryptedPassword parameter (just add this Xml element to the file if it is missing)
- The userLogName defined here will be used in the next paragraph.
Configure the runtime to use the new configuration
Open the <runtimeDirectory>properties/engines/commonParameters.xml file
Update the elements to use your database xml file instead of the default
Example for mysql
The value of the userLogDefaultName must be the same as the one of userLogName in the database configuration file.
Copy the jdbc libs corresponding to your database in <runtimeDirectory>/lib/jdbc , otherwise the Runtime will not be able to connect to the database. We used the mysql-connector-java-5.1.33-bin.jar for our example.
Start the Runtime
It may take a little longer to start, because it will create all the tables needed for the logs in the database schema that you specified.
You should now have log tables in your schema
Note about multiple Runtime on the same database
You can have multiple Runtimes using the same database schema to store logs. If it is the case, all will have the same logs which will be centralized at the same place.
We advise to use the same Runtime version for all the Runtimes when you do that, to avoid problems of different behavior between Runtime versions (older versions have less tables and columns for examples).