Membrane can log metadata about service invocations to any database that can be accessed via JDBC.
In this example we configure Membrane to log to an embedded H2 database. For production you can use any other JDBC database like postgres or mysql.
-
Copy the
h2-*.jarinto theMEMBRANE_HOME/libdirectory -
Go to the
examples/logging/jdbc-databasedirectory. -
Start Membrane using
membrane.shormembrane.cmd. -
Open the URL http://localhost:2000/ in your browser (trigger a request).
-
Stop Membrane to shut down the embedded H2 database. Otherwise, it is not possible to connect to it from the H2 Shell.
-
Query the database using the H2 Shell (run this from
examples/logging/jdbc-database):java -cp h2-2.4.240.jar org.h2.tools.Shell -url "jdbc:h2:./membranedb" -user membrane -password secret -
In the SQL prompt, list tables and query the statistic table:
select * from statistic;
See:
- statisticsJDBC reference