Skip to main content
pixelbendr
Participating Frequently
April 10, 2018
Question

CFDebug display debug with load balancer or OneLogin creds

  • April 10, 2018
  • 1 reply
  • 420 views

Is it possible to control when ColdFusion outputs the debug information at the bottom of the page by something other than IP?  We moved our servers into AWS Cloud and they are going through load balancer, so all the IPs look the same to the server.  Plus we have folks working remotely, so their IPs keep changing.  We use OneLogin for authentication, and we can have a Developer role in there.  So we'd like to find a way to display all the debug at the bottom of the page only if a Developer is logged in.

    This topic has been closed for replies.

    1 reply

    Community Expert
    April 10, 2018

    Yes, you can do this. You can enable debug output for all IPs, then programmatically disable it in Application.cfc/cfm.

    <cfif ...>

         <cfsetting showdebugoutput="false">
    </cfif>

    ColdFusion Help | Controlling debugging information in CFML

    You can use the X-Forwarded-For header to identify specific client IP addresses passed through the load balancer. Or you could look for other attributes and use those instead. I don't know anything about OneLogin specifically, but if it can be detected by the web server, you can filter in CF.

    That said, there is a significant reduction in load capability once you enable debug output, and you should really only use it in development environments, or when you're trying to debug an urgent problem in production. You should definitely not do leave it enabled in production generally.

    Dave Watts, Fig Leaf Software

    Dave Watts, Eidolon LLC
    pixelbendr
    Participating Frequently
    April 10, 2018

    I wonder if there is a ColdFusion API way to invoke the Debug output without having to open it up to all IPs first.

    Community Expert
    April 10, 2018

    No, as far as I'm aware this is the only way. But it's not the opening it up that causes the server to perform poorly, it's just having debugging enabled for any user at all.

    Dave Watts, Fig Leaf Software

    Dave Watts, Eidolon LLC