Code Monkey home page Code Monkey logo

sloggly's Introduction

SLoggly

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

Features

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

Setup

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 "https://logs.loggly.com"

    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

Examples

Single Log

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

Batching Logs

//Enable batching
Loggly.BATCH_LOGS=True;

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

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

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

//Flush the message queue
l.flush();

Screenshot from Loggly

Screenshot

sloggly's People

Contributors

jeffhube avatar pcon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.