By default, the Logstash appender becomes enabled with the installation of stachebox into an application.
To use the defaults while customizing the application name you can either add the LOGSTASH_APPLICATION_NAME environment variable, or you can provide the variable in your config/Coldbox.cfc:
In addition, if choosing to run a stachebox instance as a standalone installation, you may install only the logstash module in to your application and configure it to log either directly to the elasticsearch server ( the default, will use the [Elasticsearch configuration options] ) or, to log directly to the stachebox instance API, you may a custom API configuration to your Coldbox configuration file, like so:
In addition, you may configure separate appenders with different logging levels. For example, you might want warn level logging for a custom module, such as authentication. An example configuration of this type of custom appender:
logstash={class="cbelasticsearch.models.logging.LogstashAppender",properties={ // Provide a unique name for the application ( optional ) - useful for filtering shared log indexes"applicationName":"App Warnings", // Optional release version"releaseVersion":"1.0.0", // the frequency of index rotation"levelMin":"WARN","levelMax":"WARN"}}
Then, in your top-level logbox configuration you would simply add:
which would log only warnings from that specific module to the separate -warnings index configured above.