Logging using ELK Stack | |
Tiki has comprehensive built in logging capabilities as part of Action Log and to a lesser extent System Log. Nevertheless, high volume sites might find these logging capabilities insufficient, or more importantly not performant enough, since these internal logging mechanisms save their data in the MySQL database that is used by Tiki as a whole. One popular logging solution used by many large sites on the Internet uses the ELK stack, which not only provides a highly performant way to handle log processing, it provides a very flexible way to query and analyze data from the logs themselves. It is log from Tiki to the ELK stack, which would be useful for advanced system administrators managing large sites. There are already numerous articles explaining how and why to setup logging using the ELK stack available on the Internet, including on Elastic's own website, so the purpose of this documentation is to focus on how to use such a setup with Tiki, rather than repeating the information that is out there. Available from Tiki 16
|
Overall architecture | |
And then the logs can be queried or analyzed using Kibana and related tools that work with Elasticsearch. |
Step 1: make sure you have ELK installed. | |
|
Step 2: setup your Tiki server to log information to the Apache logs | |
In you Apache VirtualHost configuration, switch the log format to the tikicombined log format. Reload Apache to refresh the configuration. Note that the index name of the Elasticsearch index you want the logs to be indexed into is specified as "log_yourindexname" in the following example. Copy to clipboard
.htaccess Copy to clipboard
|
Step 3: setup Filebeat to send logs to Logstash | |
First make sure Filebeat is installed and running on your server. And then make sure it is using a configuration file containing the minimum something like the following: filebeat.yml Copy to clipboard
|
Step 4: setup Logstash configuration file | |
On the logstash server, you are going to need a configuration file that processes Tiki log files, and also pick up the log files sent by FileBeat. tiki.conf Copy to clipboard
|
Step 5: Setup the events you wish to log. | |
In order to log Tiki events in addition to the username, object type, object ID, URL, query string etc which are more standard parameters, you have to configure events to be Logged, similar to how they are configured to be Recorded in an PluginActivityStream. To setup events to be logged:
|
Tips | |
|