alager has asked for the wisdom of the Perl Monks concerning the following question:

I'm just starting out with Net::Server::Prefork and I would like to be able to send some debug information to the console, but I can't figure it out. I'm not using a log file, so some information is put on the console when I start the server, but I can't get anything I print to appear.
I've tried printing to STDERR and self->log(4,"test message\n"); and neither works. How can I do this?
My understanding is, that if I don't use the log file, then STDERR isn't redirected, only STDIN and STDOUT are redirected to the socket.

Thanks,
Aaron

Replies are listed 'Best First'.
Re: Net::Server console or debug output?
by Anonymous Monk on Apr 28, 2009 at 06:52 UTC
    What is your log_level?
      I have log level set to 4.

      I've even tried using the log file, with log level at 4, and I only get IP connection entries.
      Neither print to STDERR nor log->(4,"test message"); show up anywhere.
      I understand that if I use the log file that STDERR goes to dev/null.

      **UPDATE**
      This morning the log output has decided to cooperate, and display on the console. However, I'm still not
      getting *my* output to display.
      The device on the other end is an
      embedded device, so I can not get
      the output from the socket.
      The two lines I've tried to print with are:

      $self->log(4,"client said '$RxString'\r\n"); print STDERR "client said '$RxString'\r\n";

      Thanks,
      Aaron

        UPDATE again...WTF!?!?
        As I was writing my last update, the messages started appearing! First the CONNECT TCP Peer messages only, then my "client said" messages....this is too weird for me.

        Aaron