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 that comes with 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 DataStax Enterprise and Solr on a single node. See Starting DSE and DSE Search.
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 installationscd /usr/share/dse-demos/log_search
Tar distribution, such as Maccd $DSE_HOME/demos/log_search
Open another shell window or tab and add the schema:
The script posts solrconfig.xml and schema.xml to these locations:
Start a Hadoop job using demo's log4j settings:
Open the results in a web browser, where you can view and search for messages:
Use the search/filter feature to view the log messages.