= Bonita Engine Queriable logger
:description: Queriable logger provides information about important events that happened in the Bonita Platform.

Queriable logger provides information about important events that happened in the Bonita Platform.

[NOTE]
====
For subscription editions only.
====

== Purpose

The queriable logger service provides information about important events in the Bonita Platform that are not directly related to execution of a process. The log includes information about administration operations such as deployment of a new process definition, commands, reporting, actor mapping, Portal Look & Feel themes, and organization and user management.

The Bonita Engine stores information in the queriable log. The information in the log is accessible using the https://javadoc.bonitasoft.com/api/{javadocVersion}/index.html[LogAPI].

The information available from the queriable log is primarily for the platform and process administrator. It is not intended to be used as a notification system: avoid pooling on the queriable log. If you need to be notified of specific events, use the configurable event service.

== Usage

Here is an example of how to search for log message about a specific activity:

[source,groovy]
----
final SearchOptionsBuilder builder = new SearchOptionsBuilder(0, 100);
builder.filter(LogSearchDescriptor.ACTION_SCOPE, aTaskId);
builder.searchTerm("Adding a new user");
builder.sort(LogSearchDescriptor.ACTION_TYPE, Order.ASC);
final LogAPI logAPI = TenantAPIAccessor.getLogAPI(session);
final SearchResult<Log> searchedLogs = logAPI.searchLogs(builder.done());
for (Log log : searchedLogs.getResult()) {
     // Print the detailed user creation message:
    System.out.println(log.getMessage());
}
----

== Implementation details

The queriable logger service stores log message in the Bonita Engine back-end database using the Hibernate library. The https://github.com/bonitasoft/bonita-engine/blob/master/services/bonita-log/src/main/java/org/bonitasoft/engine/services/QueriableLoggerService.java[interface] and the https://github.com/bonitasoft/bonita-engine/tree/master/services/bonita-log/src/main/java/org/bonitasoft/engine/services/impl[implementation] of the service are available from the source code repository on https://github.com/bonitasoft/[GitHub].


== Disabling the Queriable logger

Each queriable log type can be turned off individually with its associated property. The properties must be listed into the `/setup/platform_conf/current/tenants/[tenantId]/tenant_engine/bonita-tenant-sp-custom.properties` file.
 
=== Find the list of properties

* You can deactivate the logging on all the events listed xref:event-handlers.adoc#_event_list[here]. 
* Or, you can also find a set of properties for each product version. You'll find them in a java library: The `bonita-tenant-sp.xml` file contains the list of properties, and it is packed into the `/server/webapps/bonita/WEB-INF/lib/bonita-server-sp-[BonitaVersion].jar` file.

=== Disable the Queriable Logs

. Use the xref:bonita-bpm-platform-setup.adoc[Platform configuration setup tool] to pull the configuration on the disk: `./setup.sh pull`
. Edit the `/setup/platform_conf/current/tenants/[tenantId]/tenant_engine/bonita-tenant-sp-custom.properties` file.
. Add one line per property for each type of queriable log you want to disable, and set it to false, e.g.: 
`bonita.tenant.queriable.log.ACTOR_CREATED.INTERNAL=false`
`bonita.tenant.queriable.log.APPLICATION_PAGE_DELETED.INTERNAL=false`
. Use the xref:bonita-bpm-platform-setup.adoc[Platform configuration setup tool] to push the configuration in the database: `./setup.sh push`
. xref:tomcat-bundle.adoc#start[Restart] the application server
