Raful Mr Mitchell H wrote:
I have my code pasted below. My module, loaded with <Location> directive in Apache2, works well. However, sometimes switches don't respond correctly to bulk queries of fdbPorts object. What I want to do is to be able print the value of my variables either to the browser or a log file. A regular print statement does not work for this. The relevant variables are in a subroutine called from my sub handler.
I'm not entirely sure where, in those lines of unindented HTML, you're trying to perform your logging. The only thing I could find quickly was the following code, but I can't be certain that's the subject of your question.
if( $arp_session->{ErrorNum} ){ print "Got $arp_session->{ErrorStr} for $router\n"; }
In order to print log messages to Apache's (or your virtual host's) error log, you can use the following.
use Apache2::RequestUtil;
use Apache2::Log;
Apache2::RequestUtil->request->log->error('some_text');
Substituting other log levels (debug, info, warn, etc.) works, as well.
See the following URL for more information.
http://perl.apache.org/docs/2.0/api/Apache2/Log.html#LogLevel_MethodsIf this isn't what you're seeking, perhaps you could include a more concise test case and a more elaborate explanation in your next post?
Colin
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.