cferror and Server Name

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default cferror and Server Name

    Hello All,

    We have an exception handler page that will email us the page the user was on
    and the page the user was trying to get to.
    My question is we have 2 servers a testing and the live one. The folder
    structure is exactly the same on both.
    When an error happens and we are emailed, it does not show which server the
    error happened on. I have tried using getbasetemplate path but it just starts
    with the c:

    Does anyone know a way I can get the server name to output somewhere in the
    email so we can tell if a users has a problem on a page or it is just us
    messing around with the pages?

    Thanks for the help in advance.
    jlmoshier

    jmoshier Guest

  2. Similar Questions and Discussions

    1. cferror not catching errors
      I can't let you get away with that. There is definitely a problem with <cferror> in CF MX as I see it. I have the same or similar problem that was...
    2. cferror question??
      Hi all... I am using cferror to catch errors in our site and am able to catch every type of error except for a "database" error. Here is what our...
    3. CFERROR and logging
      I cannot get errors to be logged when using the cferror tag. When I add the cflog to the errorhandling file, it displays the output of the cflog...
    4. CFERROR
      Hi. I am just testing a simple site to try cf. The header is in application.cfm and the fotter in OnRequestEnd.cfm The main page is the requested...
    5. cferror woes
      Hello, I currently have cferror catching errors on a clients website which is running from our staging server. The client also has their own UAT...
  3. #2

    Default Re: cferror and Server Name

    <cfoutput>#cgi.server_name#</cfoutput>

    Or better still

    <cfif isdefined("form.ACode")><cfset form.ACode="[SCRUBBED]"></cfif>
    <cflock scope="SERVER" type="READONLY" timeout="10">
    <cfset variables.CFVer=Left(server.coldfusion.ProductVers ion,1)>
    </cflock>
    <cfloop

    list="CFCATCH,ERROR,APPLICATION,ATTRIBUTES,CALLER, CGI,CLIENT,FORM,REQUEST,SESSI
    ON,SERVER,THIS,THISTAG,URL,VARIABLES"
    index="loopItem">
    <cfif IsDefined("#loopItem#")>
    <cfif variables.CFVer lt 6>
    <br><br><cfoutput><b>#loopItem#</b></cfoutput>
    <cfdump var="#Evaluate(loopItem)#">
    <cfelse>
    <cfdump var="#Evaluate(loopItem)#" label="#loopItem#">
    </cfif>
    </cfif>
    </cfloop>

    Get ready for a BIG dump if you use that one (trimming off the 'variables'
    scope will remove all query output). And if you are running either CF5 or CF6+
    you can shave off that cflock'd cfset and one of the two results of the cfif,
    depending on your version.

    HtH,

    --Matt--
    MSB Web Systems... [url]http://mysecretbase.com[/url]
    "The mistake you make is in trying to figure it out."
    - Tennessee Williams


    MattRobertson Guest

  4. #3

    Default Re: cferror and Server Name

    Matt,
    I totally forgot about the cgi variables. Thanks that worked perfect for me.

    jlmoshier
    jmoshier Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139