Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A class designed to send logs to Loggly from Salesforce
branch: master

Adding new singleLog methods that take in an exception (closes #3) an…

…d one that takes in just a log message
latest commit 810df92ef5
Patrick Connelly pcon authored


SLoggly is a class and an AppExchange app for logging to Loggly from Salesforce APEX classes.


  • Custom settings for setting Loggly URL
  • Support for on the fly batch logging (see examples)
  • JSON logs in Loggly [1]


Configure Loggly

  • Create a new input in Loggly that is HTTPS and json

    Loggly Input

  • Copy your input URL from the input page

Configure Salesforce

  • Add Loggly to your allowed remote sites

    • Setup -> Secrity Controls -> Remote Site Settings
    • Click New Remote Site
    • Name it "Loggly"
    • Set the Remote Site URL to ""

      remote sites config

  • After deploying the Custom Settings object and the Loggly class file, add a new Loggly custom setting

    • Setup -> Develop -> Custom Settings
    • Click Manage next to Loggly
    • Click New
    • Name it "default" and enter in you URL from the Loggly Configuration section
    • Then set the other custom parts to the logging

      sloggly config


Single Log

Loggly.singleLog('Error Message',, 'LEVEL');

Batching Logs

//Enable batching

//Create new instance of the Loggly class
Loggly l = new Loggly();

//Batch a message
l.add('Error Message',, 'LEVEL');

//Any calls to Loggly.singleLog after setting BATCH_LOGS will automatically be batched and sent with the .flush

//Flush the message queue

Screenshot from Loggly


Something went wrong with that request. Please try again.