oarevalo / BugLogHQ

BugLogHQ is a tool to centralize the handling of automated bug reports from multiple applications. BugLogHQ provides a unified view of error messages sent from any number of applications, allowing the developer to search, graph, forward, and explore the bug reports submitted by the applications.
http://www.bugloghq.com
155 stars 67 forks source link

Where is my extraInfo key going? #115

Open atuttle opened 9 years ago

atuttle commented 9 years ago

My table (MSSQL) has type text for the HTMLReport column. I'm not sure where it could be going. I know I'm passing a structure, but it's nowhere to be found in the error report I see in BLHQ. :(

KrunchMuffin commented 9 years ago

post the code you are using to pass it in.

atuttle commented 9 years ago

sample error log: (FW/1 controller)

    function error( rc ){
        if (framework.getEnvironment() eq "dev"){
            return;
        }
        if ( structKeyExists(request, "failedAction") ){
            logError(
                message = "MyApp Error during `#request.failedAction#`"
                ,exception = request.exception
                ,extraInfo = {rc: rc}
                ,severityCode = "FATAL"
            );
        }else{
            logError(
                message = "MyApp Error (unknown action)"
                ,exception = request.exception
                ,extraInfo = {rc: rc}
                ,severityCode = "FATAL"
            );
        }
    }

logError:

    function logError(
        required string message
        ,any exception
        ,any extraInfo
        ,string severityCode = "ERROR"
    ){
        buglogService.notifyService( argumentCollection=arguments );
    }

Code for buglogService:

component {

    variables.buglog = createObject("com.foo.util.bugLogService").init(
        "http://buglog.foo.com/listeners/bugLogListenerREST.cfm"
        ,"helpdesk@foo.com"
        ,"helpdesk@foo.com"
        ,cgi.host_name
        ,"55555555-5555-5555-5555555555555555"
        ,"MyApp"
    );

    function notifyService(
        required string message
        ,any exception
        ,any extraInfo
        ,string severityCode
    ){
        variables.buglog.notifyService( argumentCollection=arguments );
    }

}
KrunchMuffin commented 9 years ago

what are you passing in for the extraInfo arg?

I am using onError in app.cfc and do something like this...

<cfset var extraInfo = {}>
<cfif isDefined("form")>
    <cfset structAppend(extrainfo,form)>
</cfif>
<cfif isDefined("session")>
    <cfset structAppend(extrainfo,session)>
</cfif>
<cfset userip = CGI.REMOTE_ADDR>
<cfset ipinfo = {"ip address" = userip}>
<cfset structAppend(extraInfo,ipinfo)>
<cfset application.buglog.notifyService(arguments.exception.message, arguments.exception, extraInfo)>
oarevalo commented 9 years ago

The "extraInfo" data is appended to the HTMLReport section, so it's not available by itself on the database. It's purpose/use is mostly "visual" when looking at a full error report on the web app (or email)

Is having the extraInfo as a separate field on the DB something you guys think would be useful for everyone?

Thanks,

Oscar

On Thu, Dec 4, 2014 at 9:01 AM, Derek notifications@github.com wrote:

what are you passing in for the extraInfo arg?

I am using onError in app.cfc and do something like this...

— Reply to this email directly or view it on GitHub https://github.com/oarevalo/BugLogHQ/issues/115#issuecomment-65664638.

Oscar Arevalo http://about.me/oarevalo http://www.coldbricks.com - Content Management System http://www.oscararevalo.com - My Blog

KrunchMuffin commented 9 years ago

No, not something I need.

I assumed he knew that but wasn't seeing the info reported.

atuttle commented 9 years ago

I do know that, but it's just not showing up!

I suspect truncation of one sort or another:

image

It seems like the table is left unclosed (due to truncation) and the footer then moves up into the html report area.

oarevalo commented 9 years ago

ah ok, i see now. Yes this defintely looks like there is some truncation going on. If you are using MySQL then the table is created by default as a "Text" field, you may try changing it to "MediumText" or something bigger.

Also on the CFIDE dsn settings (if you are using ACF) I believe the is a setting to control the max size of CLOBs and BLOBs

Another thing I could think is that you may try looking at the HTML source of your truncated dump, maybe there is an error that is just not visible on the rendered html.

On Thu, Dec 4, 2014 at 9:48 AM, Adam Tuttle notifications@github.com wrote:

I do know that, but it's just not showing up!

I suspect truncation of one sort or another:

[image: image] https://cloud.githubusercontent.com/assets/46990/5303023/c2de878a-7bb3-11e4-99b6-d476490db054.png

It seems like the table is left unclosed (due to truncation) and the footer then moves up into the html report area.

— Reply to this email directly or view it on GitHub https://github.com/oarevalo/BugLogHQ/issues/115#issuecomment-65672244.

Oscar Arevalo http://about.me/oarevalo http://www.coldbricks.com - Content Management System http://www.oscararevalo.com - My Blog

KrunchMuffin commented 9 years ago

he is using sql server with TEXT which is 2,147,483,647 bytes. If you are exceeding that, u may want to look into what you are storing and if you really need it. if doing dumps, maybe change it to text to remove all the JS

atuttle commented 9 years ago

It's the exception object, I'm not doing the dump -- that's done by BLHQ.

I've just doubled the long text and blob buffers and enabled BLOB and CLOB retrieval. We'll see if that helps.

image