ColdFusion/Railo Debuging Display

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 4094 Views - Last Post: 16 January 2012 - 12:43 PM Rate Topic: -----

#1 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

ColdFusion/Railo Debuging Display

Posted 13 January 2012 - 05:30 PM

I currently have my Railo to display debugging information. My problem is that this displays on any computer. Is it possible to display this information only on one computer, either through ColdFusion cod or in the Railo control?

Any help would be greatly appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: ColdFusion/Railo Debuging Display

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1911
  • View blog
  • Posts: 3,441
  • Joined: 13-January 08

Re: ColdFusion/Railo Debuging Display

Posted 13 January 2012 - 11:50 PM

I haven't worked with Railo personally but a quick Google found this: http://classic.railo....cfm?treeID=277.

Just like CF has a CF Admin where you can set the various aspects of the ColdFusion server, Railo appears to have a global Server Administrator that can control debug settings.
Was This Post Helpful? 1
  • +
  • -

#3 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

Re: ColdFusion/Railo Debuging Display

Posted 14 January 2012 - 08:22 AM

Yes, but unfortunately Railo only has options for on and off, and what template to use. There is no option for who to display it to.

Would there be a way to use a <cfif> tag to check the ip address, and put the debugging in there. then the debugging page would only display on that computer.

I would really like to have debugging, but if I have to turn it off, I can do that.
Was This Post Helpful? 0
  • +
  • -

#4 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1911
  • View blog
  • Posts: 3,441
  • Joined: 13-January 08

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 06:21 AM

Well, you could try putting a conditional CFIF around a CFSETTING tag with the attribute SHOWDEBUGOUTPUT on pages where you want debugging to show up.

If you want to be more clever, try seeing if you can stick it into the onRequestStart method so it's called by each .cfm as they're loaded.

The conditional if would be for something like "if the user is from XXX IP" or "if the user has X cookie"...that kind of thing. Stuff only you as the developer could might have.
Was This Post Helpful? 0
  • +
  • -

#5 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 07:25 AM

I found how to get the IP address of the client
<cfoutput>#CGI.REMOTE_ADDR#</cfoutput>
but when i try to use it in the debugging display, I get an error.

<cfoutput>
<cfif #CGI.REMOTE_ADDR# = 191.168.1.104>

<cfadmin action="printDebug">
</cfif>
</cfoutput>



But when i use this code, I get the error:
invalid variable declaration [2]

Does anyone know why this is happening.
Was This Post Helpful? 0
  • +
  • -

#6 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 07:34 AM

View Postjk145, on 16 January 2012 - 07:25 AM, said:

I found how to get the IP address of the client
<cfoutput>#CGI.REMOTE_ADDR#</cfoutput>
but when i try to use it in the debugging display, I get an error.

<cfoutput>
<cfif #CGI.REMOTE_ADDR# = 191.168.1.104>

<cfadmin action="printDebug">
</cfif>
</cfoutput>



But when i use this code, I get the error:
invalid variable declaration [2]

Does anyone know why this is happening.


I tried retyping the code, and am now getting
there is no property with name [1]
Was This Post Helpful? 0
  • +
  • -

#7 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1911
  • View blog
  • Posts: 3,441
  • Joined: 13-January 08

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 07:46 AM

View Postjk145, on 16 January 2012 - 09:25 AM, said:

I found how to get the IP address of the client
<cfoutput>#CGI.REMOTE_ADDR#</cfoutput>
but when i try to use it in the debugging display, I get an error.

<cfoutput>
<cfif #CGI.REMOTE_ADDR# = 191.168.1.104>

<cfadmin action="printDebug">
</cfif>
</cfoutput>



But when i use this code, I get the error:
invalid variable declaration [2]

Does anyone know why this is happening.


Yep. Common mistake with CFIF. Can't confuse the "=" with "EQ" for CFIF. I don't know about CFADMIN (appears to be a Railo-specific tag) but the CFIF statement is prolly broken (or at least it would be if it were Adobe or BlueDragon CF).
Was This Post Helpful? 0
  • +
  • -

#8 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 08:26 AM

View PostCraig328, on 16 January 2012 - 07:46 AM, said:

View Postjk145, on 16 January 2012 - 09:25 AM, said:

I found how to get the IP address of the client
<cfoutput>#CGI.REMOTE_ADDR#</cfoutput>
but when i try to use it in the debugging display, I get an error.

<cfoutput>
<cfif #CGI.REMOTE_ADDR# = 191.168.1.104>

<cfadmin action="printDebug">
</cfif>
</cfoutput>



But when i use this code, I get the error:
invalid variable declaration [2]

Does anyone know why this is happening.


Yep. Common mistake with CFIF. Can't confuse the "=" with "EQ" for CFIF. I don't know about CFADMIN (appears to be a Railo-specific tag) but the CFIF statement is prolly broken (or at least it would be if it were Adobe or BlueDragon CF).


When I try <cfif #CGI.USER_ADDR# EQ 192.168.1.101>
I get the error:
there is no property with name [1]
Was This Post Helpful? 0
  • +
  • -

#9 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1911
  • View blog
  • Posts: 3,441
  • Joined: 13-January 08

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 08:33 AM

Try it like this:
<cfif CGI.USER_ADDR EQ "192.168.1.101">

Was This Post Helpful? 0
  • +
  • -

#10 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 10:39 AM

View PostCraig328, on 16 January 2012 - 08:33 AM, said:

Try it like this:
<cfif CGI.USER_ADDR EQ "192.168.1.101">


I tried it like that, and now get:
there is no property with name [1]
Was This Post Helpful? 0
  • +
  • -

#11 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1911
  • View blog
  • Posts: 3,441
  • Joined: 13-January 08

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 10:46 AM

View Postjk145, on 16 January 2012 - 12:39 PM, said:

View PostCraig328, on 16 January 2012 - 08:33 AM, said:

Try it like this:
<cfif CGI.USER_ADDR EQ "192.168.1.101">


I tried it like that, and now get:
there is no property with name [1]



Ugh! Yep, there wouldn't be. My guess is that what you're seeing is a Railo version of "variable doesn't exist" message and that would be because cgi.user_addr prolly doesn't exist.

Try using CGI.REMOTE_ADDR instead. You can also do a dump of the CGI scope to see what is available to Railo.
<cfdump var="#cgi#">

Was This Post Helpful? 1
  • +
  • -

#12 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 10:56 AM

View PostCraig328, on 16 January 2012 - 10:46 AM, said:

View Postjk145, on 16 January 2012 - 12:39 PM, said:

View PostCraig328, on 16 January 2012 - 08:33 AM, said:

Try it like this:
<cfif CGI.USER_ADDR EQ "192.168.1.101">


I tried it like that, and now get:
there is no property with name [1]



Ugh! Yep, there wouldn't be. My guess is that what you're seeing is a Railo version of "variable doesn't exist" message and that would be because cgi.user_addr prolly doesn't exist.

Try using CGI.REMOTE_ADDR instead. You can also do a dump of the CGI scope to see what is available to Railo.
<cfdump var="#cgi#">


After trying <cfif CGI.REMOTE_ADDR EQ "192.168.1.101"> (which it is, I can output that onto a page and it works perfectly, giving me the correct IP address) it still gives the same message.

The interesting thing is that whatever is on line 2 throws the error. Even if there is only one line in the .cfm page (the way it started) it throws an error for line 2:

there is no property with name [1]

The error occurred in /opt/railo/tomcat/webapps/ROOT/WEB-INF/railo/context/templates/debugging/debugging.cfm: line 2

1: <cfadmin action="printDebug">

I am confused.
Was This Post Helpful? 0
  • +
  • -

#13 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 11:19 AM

I am not sure what exactly happened, but it worked. After restarting several times, it now only displays on that computer.
I also have it dumping all of the variables, so that I can see them.


<cfif CGI.REMOTE_ADDR EQ "192.168.1.101">
	<cfadmin action="printDebug">
	<cfdump var="#FORM#" label="Form" expand="no">
	<cfdump var="#URL#" label="URL" expand="no">
	<cfdump var="#SESSION#" label="Session" expand="no">
 
	<cfdump var="#APPLICATION#" label="Application" expand="no">
	<cfdump var="#CGI#" label="CGI" expand="no">
	<cfdump var="#CLIENT#" label="Client" expand="no">
	<cfdump var="#REQUEST#" label="Request" expand="no">
	<cfdump var="#SERVER#" label="Server" expand="no">	
</cfif>



The CFADMIN tag is the Railo tag to output debugging.

Thanks for your help.
Was This Post Helpful? 0
  • +
  • -

#14 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1911
  • View blog
  • Posts: 3,441
  • Joined: 13-January 08

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 11:31 AM

I'd suggest then that you jettison the CFADMIN tag. It seems like it's not setup right or maybe the attribute you're using (or its value) is incorrect.

Try doing a CFTRY/CFCATCH for pages that throw errors and in the CFCATCH block do a CFDUMP of the cfcatch scope and see how you do.
Was This Post Helpful? 0
  • +
  • -

#15 jk145  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 09-January 12

Re: ColdFusion/Railo Debuging Display

Posted 16 January 2012 - 12:12 PM

View PostCraig328, on 16 January 2012 - 11:31 AM, said:

I'd suggest then that you jettison the CFADMIN tag. It seems like it's not setup right or maybe the attribute you're using (or its value) is incorrect.


What would you suggest I use for debugging, instead of the CFADMIN tag. It is working now.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2