Code Monkey home page Code Monkey logo

loggly-castor's Introduction

loggly-castor

JavaScript library to do cross site log POSTing to Loggly. You can use this to log directly out of your JavaScript to Loggly, or just record the fact someone hit a page on your site.

Installation

Include the loggly.js file in a web page. You can use our CloudFront version if you like:

http://cloudfront.loggly.com/js/loggly-0.1.0.js

Create a new HTTP input in your Loggly account, make a note of the URL, and then edit and use the following code in that same web page:

  <script type="text/javascript"> 
    window.onload=function(){
      castor = new loggly({ url: 'http://logs.loggly.com/inputs/a2e232e9-4827-49aa-9d28-e18e5ba5a818?rt=1', level: 'info'});
      castor.info("url=" + window.location.href + " browser=" + castor.user_agent + " width=" + castor.browser_size.width);
    }
  </script> 

This should result in the page posting an event to Loggly that looks something like this:

source=castor url=http://www.geekceo.com/ browser=MozillaNetscape5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57 Safari/534.24 width=1009

Log Levels

Set the log level using the level: 'info' parameter. Call the library using the error, warn, info, debug and log methods. Events called with these methods that match or exceed the current logging level will be forwarded on to Loggly.

loggly-castor's People

Contributors

kordless avatar

Stargazers

Wim Mostmans avatar Jan Killian avatar Julian Bilcke avatar Ionel Roiban avatar Paul Dufour avatar Olivier TASSEL avatar Stephen B avatar Steffen Opel avatar  avatar Ankur Agarwal avatar Hertzel Karbasi avatar Francesco Ceccon avatar Robert McGuinness avatar Jeff Beck avatar Michael Blume avatar Dali Kilani avatar Zvi avatar

Watchers

Deprecated avatar Dhruv Sharma avatar James Cloos avatar Ivan von Nagy avatar Jakub Fojtl avatar Dave Mangot avatar Peter N avatar Luke Thomas avatar Joey Nelson avatar  avatar alex seubert avatar vivekdev avatar Jiri Tomek avatar Filip Elias avatar Larry Foulkrod avatar Alex Dingle avatar Vinh Nguyen avatar Chris Casey avatar  avatar S. Meena avatar  avatar Hunter Sherman avatar Jirka Kruml avatar Vladimir Kopso avatar  avatar Lukáš Klimeš avatar Dušan Želiar avatar  avatar Vojtech Kuban avatar Samuel Móro avatar  avatar  avatar

loggly-castor's Issues

Add jsonp support to loggly

This code would be a lot cleaner if loggly supported jsonp. That way there wouldn't have to be a "janky" cross domain iframe injected into the page.

thoughts?

License

Hi Mike, I noticed the source actually says:

* Copyright (c) 2011 Loggly, Inc.
* All rights reserved.

Is this adapter actually under an open source/libre license or really "all rights reserved"?

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.