Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Installing and configuring graylog is out of the scope of this document and there is are plenty of good docs in on the graylog documentation site.

...

Download a release for logstash-gelf from its releases page in the github repo in to your Abiquo servers. At the time of this writing, the latest version is 1.11.0, so if you download a newer version, you'll need to adapt the filenames listed in this document.

Once we have the jar file for the plugin in on the servers, we will need to copy the jar file in into the lib folder of each webapp:

...

In order to make Abiquo send logs to the graylog instance, we will also need to modify the logging config file, logback.xml for each webapp, similar as to what's described in on the Configure webapp logging page.

...

  • Appender configuration. This section configures the behaviour behavior of the plugin, setting the target for the logs and options in the plugin. In this case, of special interest are:


    • host: The graylog host where to send the logs to. It also specifies using standard UDP Gelf logging.

    • originHost: The string that will appear as the source field in graylog.

    • additionalFields: Some additional fields to add to the messages to give them more context. In this case, note we are setting a webapp field to specify which of the webapps is sending the logs.

      Code Block
          <appender name="GELF" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
              <host>udp:10.60.13.47</host>
              <port>12201</port>
              <originHost>nardo40</originHost>
              <version>1.1</version>
              <facility>java-test</facility>
              <extractStackTrace>true</extractStackTrace>
              <filterStackTrace>true</filterStackTrace>
              <mdcProfiling>true</mdcProfiling>
              <timestampPattern>yyyy-MM-dd HH:mm:ss,SSSS</timestampPattern>
              <maximumMessageSize>8192</maximumMessageSize>
      
              <!-- This are static fields -->
              <additionalFields>abiquoenv=nardo40,webapp=am</additionalFields>
              <!-- Optional: Specify field types -->
              <additionalFieldTypes>abiquoenv=String,webapp=String</additionalFieldTypes>
      
              <!-- This are fields using MDC -->
              <mdcFields>mdcField1,mdcField2</mdcFields>
              <dynamicMdcFields>mdc.*,(mdc|MDC)fields</dynamicMdcFields>
              <includeFullMdc>true</includeFullMdc>
          </appender>
  • Add the appender to the logger output. At the end of the log config file, you need to add this appender to the output so it actually gets to send any log lines

    Code Block
        <root>
            ...
            <appender-ref ref="GELF" />
        </root>

...

The last step is to restart the Abiquo tomcat service. Since we added a new plugin we need to restart tomcat so it takes that new plugin into account. On your graylog server, you 'll should now be able to see the messages comming coming in.