Skip to content

Log Shippers

Using the FusionReactor agent, you can send additional logs hosted on your servers themselves with only minor configuration.

However, there are some drawbacks to this approach:

  • Sending logs using a process running within your application can reduce performance if there is a high volume of logs.

  • Scraping logs does not allow you to apply custom labels to logs.

  • To get the most value out of logging you also want to send logs from alternate servers.

Alternative sources could be:

  • Application server logs (eg ColdFusion, Tomcat, Lucee)

  • Nginx logs

  • Database logs

  • IIS logs

  • Proxies

  • Docker logs

Sending logs

Use a logging client such as Promtail, fluent Bit, LOGBack, Fluentd or some other alternative.

alt alt alt alt

Send logs directly to FusionReactor Cloud by configuring the log destinations with the following URL, https://api.fusionreactor.io/logs/v1/ using basic authentication of username / password.

  • Username = FusionReactor Cloud login email.

  • Password = API key.

Generating API keys

To generate an API key, go to your account settings page in FusionReactor Cloud Account settings.

Under the API keys tab, click generate and create a key.

Sending logs to FR Cloud

Sending Logs to FusionReactor Cloud from FusionReactorAPM on Vimeo.

Sending logs to FR Cloud via Docker

Sending logs to FusionReactor Cloud using Docker from FusionReactorAPM on Vimeo.

Labelling your logs

As you will see in the examples below, all logs must have at least a job label.

Recommended labels:

  • Job

  • Host

  • Filename (if applicable)

Learn more

Labels & fields

Logging client examples

Below are examples of how to use Promtail, fluentbit and LOGBack to scrape logs from a container. We have updated the clients configuration to authenticate against FusionReactor Cloud.

Promtail

Use the installation docs to install Promtail.

Example: promtail.yml

    server:
    http_listen_port: 9080
    grpc_listen_port: 0

    positions:
    filename: /tmp/positions.yaml

    clients:
    - url: https://api.fusionreactor.io/logs/v1/
    basic`_auth:
    username: {user}
    password: {api key}

    scrape_configs:
    - job_name: nginx
    static_configs:
        - targets:
            - localhost
            labels:
            job: store-balancer
            host: localhost
            __path__: /var/log/nginx/*log

Fluent Bit

Use the install documentation to install Fluent Bit.

Example: fluent-bit.config

    [INPUT]
        Name        fusionreactor-logs
        Path        /opt/coldfusion2018/cfusion/logs/coldfusion-out.log
        Tag         cfusionout

    [INPUT]
        Name        fusionreactor-logs
        Path        /opt/coldfusion2018/cfusion/logs/coldfusion-error.log
        Tag         cfusionerr

    [OUTPUT]
        Name fusionreactor-logs
        Match cfusionout
        Url https://FR:your-api-key-here@api.fusionreactor.io/logs/v1/
        Labels {job="service-name-here",instance="hostname",filename="coldfusion-out.log"}
        LogLevel info

    [OUTPUT]
        Name fusionreactor-logs
        Match cfusionerr
        Url https://FR:your-api-key-here@api.fusionreactor.io/logs/v1/
        Labels {job="service-name-here",instance="hostname",filename="coldfusion-error.log"}
        LogLevel info

LOGBack

Use the download page to add LOGBack to your application.

Example: logback.xml

    <configuration>   
        <appender name="FRCLOUD" class="com.github.loki4j.logback.Loki4jAppender">
            <http>
                <url>https://api.fusionreactor.io/logs/v1/</url>
                <auth>
                    <username>{user}</username>
                    <password>{api key}</password>
                </auth>
            </http>
            <format>
                <label>
                    <pattern>job=${applicationName}</pattern>
                </label>
                <message>
                    <pattern>${applicationName} ${node.host}: [%-5level] %logger %mdc - %msg</pattern>
                </message>
                <sortByTime>true</sortByTime>
            </format>
        </appender>

        <appender name="FRCLOUD_ASYNC" class="ch.qos.logback.classic.AsyncAppender">
            <queueSize>500</queueSize>
            <discardingThreshold>0</discardingThreshold>
            <appender-ref ref="FRCLOUD" />
        </appender>

        <root level="INFO">
            <appender-ref ref="FRCLOUD_ASYNC"/>
        </root>

        <logger name="ROOT" level="INFO"/>
        <logger name="com.intergral" level="INFO"/>

    </configuration>

Need more help?

Contact support in the chat bubble and let us know how we can assist.