Log4j search demo

The Log4j Search Demo shows an example of searching and filtering log4j messages generated by a standard Java application.

The Log4j Search Demo shows an example of searching and filtering log4j messages generated by a standard Java application. In the demo, a Hadoop pi calculation is run with a log4j.properties file set to use the CassandraAppender included in DataStax Enterprise. As the logs are generated, they are indexed in real time by Solr and made available for searching in the demo user interface.

For information on configuring log4j, see Cassandra Log4j appender solutions.

Before starting this demo, be sure that you have started DSE Search/Solr on a single node.

Running the demo 

Procedure

Note: DataStax Demos do not work with LDAP or internal authorization (username/password) enabled.

  1. Open a shell window or tab and make the log_search directory your current directory. The location of the demo directory depends on your platform:

    RHEL or Debian installations:

    $ cd /usr/share/demos/log_search

    Tar distribution, such as Mac:

    $ cd $DSE_HOME/demos/log_search
  2. Open another shell window or tab and add the schema:
    $ ./1-add-schema.sh

    The script posts solrconfig.xml and schema.xml to these locations:

    http://localhost:8983/solr/resource/Logging.log_entries/solrconfig.xml
    http://localhost:8983/solr/resource/Logging.log_entries/schema.xml
  3. Start a Hadoop job using demo's log4j settings:
    $ ./2-run-hadoop-test.sh
  4. Open the results in a web browser, where you can view and search for messages:
    http://localhost:8983/demos/log_search/


  5. Use the search (filter) feature to view the log messages.