Git Product home page Git Product logo

raven-cfml's Introduction

raven-cfml

raven-cfml is a CFML client for Sentry.

Installation

Install source from GitHub

To install the source code:

$ git clone git://github.com/iGLOO-be/raven-cfml.git

And instantiate the object:

<cfset ravenConfig = structNew()>
<cfset ravenConfig.publicKey = "[your_public_key]">
<cfset ravenConfig.privateKey = "[your_private_key]">
<cfset ravenConfig.sentryUrl = "[http://sentry_url]">
<cfset ravenConfig.projectID = [numeric_project_id]>
<cfset ravenClient = createObject('component', '[path.to.raven].lib.client').init(argumentCollection=ravenConfig)>

Usage

Using Application.cfc

<cffunction name="OnError" access="public" returntype="void" output="false">
   <cfargument name="exception" type="any" required="true">
   <cfargument name="eventName" type="string" required="false" default="">

   <cfset ravenClient.captureException(exception)>

</cffunction>

Inside a CFML Page

<cftry>
   <!--- Code to execute --->

   <cfcatch>
      <!--- Capture a exception --->
      <cfset ravenClient.captureException(cfcatch)>

      <!--- Capture a message --->
      <cfset ravenClient.captureMessage("This is a message.")>
   </cfcatch>
</cftry>

Explore the client.cfc library for all available arguments.

Threading

It maybe helpful to wrap the capture calls inside cfthread to isolate the api call to sentry for performance.

<cftry>
   <!--- Code to execute --->

   <cfcatch>
      <cfthread action="run" name="ravenThread" exception="#cfcatch#" cgiVars="#CGI#" httpRequestData="#getHttpRequestData()#">
         <cfset ravenConfig = structNew()>
         <cfset ravenConfig.publicKey = "[your_public_key]">
         <cfset ravenConfig.privateKey = "[your_private_key]">
         <cfset ravenConfig.sentryUrl = "[http://sentry_url]">
         <cfset ravenConfig.projectID = [numeric_project_id]>
         <cfset ravenConfig.cgiVars = cgiVars>
         <cfset ravenConfig.httpRequestData = httpRequestData>
         <cfset ravenClient = createObject('component', '[path.to.raven].lib.client').init(argumentCollection=ravenConfig)>

         <cfset ravenClient.captureException(cfcatch)>
      </cfthread>
   </cfcatch>
</cftry>

Using the sentry-cfml plugin in Sentry

There is a plugin for sentry (sentry-cfml) that includes a custom interface so that raven-cfml can send CFML specific variables.

Once installed, you can reference it using

<cfset ravenConfig = structNew()>
...
<cfset ravenConfig.customHttpInterface = 'sentry_cfml.interfaces.CFMLHttp'>
...
<cfset ravenClient = createObject('component', '[path.to.raven].lib.client').init(argumentCollection=ravenConfig)>

raven-cfml's People

Contributors

fridus avatar jmacul2 avatar neilalbrock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

raven-cfml's Issues

Element 1 is undefined in a Java object of type class coldfusion.runtime.Array

My users are lately getting this error:

Element 1 is undefined in a Java object of type class coldfusion.runtime.Array
Error occured in client.cfc: line 268
Called from client.cfc line 283
Called from client.cfc line 268
Called from client.cfc line 283
Called from client.cfc line 283
Called from client.cfc line 196
Called from client.cfc line 136
Called from application.cfc line ...

Application is running on ColdFusion10

Anyone got this to connect to Sentry?

I have it all working bar the fact that the call will not connect to Sentry. Below is a JSON packet of the response from the CFHTTP call.

{""ErrorDetail"":""I\/O Exception: peer not authenticated"",""Mimetype"":""Unable to determine MIME type of file."",""Statuscode"":""Connection Failure. Status code unavailable."",""Filecontent"":""Connection Failure"",""Responseheader"":{},""Text"":""YES"",""Charset"":"""",""Header"":""""}

Not an issue ...

Hello,

I just wanted to advise that I created a new CFC based on your initial code and added some more of the available interfaces in Sentry's current SDK.

I made sure to mention you in the readme as a large part of the code is yours, I just did not want to fork as I felt it was not going to work for a pull request as I was building to work with ACF 2016.

https://github.com/GiancarloGomez/sentry-cfml

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.