• Print
  • Share
  • Dark

Configure Logback

  • Updated on 15 Jan 2019
  • 1 minute to read
  • Contributors

Downloads and Includes

The stackify-log-logback project is open source and hosted on GitHub here.

Maven artifacts are available in the central Maven repository within a few hours after a new release.


The group id is com.stackify. The artifact id is stackify-log-logback. Substitute the version number you wish to use in the dependency snippet below.



<appender name="STACKIFY" class="com.stackify.log.logback.StackifyLogAppender">
<root level=...>
    <appender-ref ref="STACKIFY" />

Be sure to shut down Logback to flush this appender of any errors and shut down the background thread:

LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();


The Stackify appender has built-in data masking for credit cards and social security number values.

Enable Masking:

Add <maskEnabled>true</maskEnabled> inside the <appender> ... </appender> tag.

Customize Masking:

The example below has the following customizations:

  1. Credit Card value masking is disabled (<maskCreditCard>false</maskCreditCard>)
  2. IP Address masking is enabled (<maskIP>true</maskIP>).
  3. Custom masking to remove vowels using a regex (<maskCustom>[aeiou]</maskCustom>)
<appender name="STACKIFY" class="com.stackify.log.logback.StackifyLogAppender">

Sending Logs Through a Proxy

If you are wanting to send your logs into Stackify through a proxy, you will want to set the 'https.proxyHost' and 'https.proxyPort' system properties. If both of these properties are set in your app, your logs go through the proxy specified.

Advanced Features: MDC, and NDC

If you're utilizing MDC (Mapped Diagnostic Context), Stackify will automatically pick up and report any data you add via MDC. This information will be available to you under the Custom Properties heading in the error details screen within Retrace.

Was this article helpful?