LOGBack appender to NATS pub/sub topic

ID: logback-nats-appender


Provides the ability to send logs to LOGBack and off-load to an external NATS pub/sub topic.

How to use it

This is a pure library plugin which includes the following dependencies:

It does not provide any end-user functionality but it is designed to be used as a dependency on other plugins that are willing to post
events through LOGBack.

See below a sample list of plugins that are providing events to LOGBack:

- Statistics Gatherer

How to configure a NATS appender in LOGBack

LOGBack assumes that you have a logback.xml configuration in your classpath.

See below a minimal logback.xml configuration that would send all the logging events to the output console and to a NATS topic called 'jenkins' to a local broker running on the localhost at port 4222.

    <appender name="NATS" class="com.gerritforge.logback.nats.NatsTopicAppender">
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <!-- encoders are assigned the type
           ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
        <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>

    <root level="INFO">
        <appender-ref ref="STDOUT"/>
        <appender-ref ref="NATS"/>




ArchivesGet past versions
Version: 0.2.2
Requires Jenkins 2.60.1
Installs: 73
This plugin has no labels
Luca Domenico Milanesio
Help us improve this page!
This content is served from the Jenkins Wiki the read-only state. We recommend moving the plugin documentation to GitHub, see the guidelines.