Menu

#3 Add logging to the scripts

open
nobody
None
7
2002-02-21
2002-02-21
No

I have installed the modules for CGI logging, but I
haven't implemented an interface. This is becoming more
and more necessary

Discussion

  • Duncan McGreggor

    • priority: 5 --> 7
     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    I added logging today, but it's a beast. I haven't gotten
    it all figured out yet. More to come later.

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    Awesome! I've done a test with the script "test_cache.cgi",
    and it works like a charm. It created the file defined in
    the .ini file under the [Logging] section (log
    path=/home/adytumsolutions/var/log/perlWebSite/error.log)

    I will test some more to flex all the interesting options.

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    Maybe it's just me, but I think that CGI::LogCarp really
    sucks. I will try another .pm for logging CGI errors:
    CGI::Log. It's not as sophisticated, but we can always make
    it what we want...

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    Okay, so maybe it's not a piece of caca... There is a
    warning in the Caching module about redefining warn or die.
    I'll keep testing this.

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    Okay, the one that I thought sucked ass is working now, and
    maybe I'm the one that sucks ass... the jury is still out.
    Logging looks nice so far, though.

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    Okay, the one that I thought sucked ass is working now, and
    maybe I'm the one that sucks ass... the jury is still out.
    Logging looks nice so far, though.

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    All I have to do on this is test the caching values from
    the ini file

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    It seems that there is a conflict between the CGI::Cache
    and CGI::LogCarp. I think it is because CGI::Log redefines
    STDERR...

    Here's there error:
    Software Error:
    Can't locate object method "FILENO" via
    package "CGI::Cache::MonitorSTDERR" (perhaps you forgot to
    load "CGI::Cache::MonitorSTDERR"?)
    at /usr/local/lib/perl5/site_perl/5.6.1/CGI/LogCarp.pm line
    1610.

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    It seems that there is a conflict between the CGI::Cache
    and CGI::LogCarp. I think it is because CGI::Log redefines
    STDERR...

    Here's there error:
    Software Error:
    Can't locate object method "FILENO" via
    package "CGI::Cache::MonitorSTDERR" (perhaps you forgot to
    load "CGI::Cache::MonitorSTDERR"?)
    at /usr/local/lib/perl5/site_perl/5.6.1/CGI/LogCarp.pm line
    1610.

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    I am using "debug" and the logfiles to try to narrow down
    exactly where the error is occuring. I might be getting
    closer; if I run the following SQL:

    INSERT INTO images VALUES
    (39,'/images/test.jpg',150,300,'Test image 2',1)

    I get the error

    DBD::CSV::Statement=HASH(0x85dd96c) is not a valid
    SQL::Statement object
    at /usr/local/lib/perl5/site_perl/5.6.1/DBD/File.pm line
    170.

    However, if I add a semi-colon to the end of the SQL
    statement, I get this error:

    Can't locate object method "FILENO" via
    package "CGI::Cache::MonitorSTDERR" (perhaps you forgot to
    load "CGI::Cache::MonitorSTDERR"?)
    at /usr/local/lib/perl5/site_perl/5.6.1/CGI/LogCarp.pm line
    1610.

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    Hmmm. Removing the -T from #!/usr/bin/perl -wT and the semi-
    colon from the query makes the errors go away. David, any
    ideas on this one?

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    I checked the logs, and the error

    Can't locate object method "FILENO" via
    package "CGI::Cache::MonitorSTDERR" (perhaps you forgot to
    load "CGI::Cache::MonitorSTDERR"?)
    at /usr/local/lib/perl5/site_perl/5.6.1/CGI/LogCarp.pm line
    1610

    is still appearing, it's just that the script is no longer
    dying at the point where this is printed to the browser (in
    fact, it's not dying at all).

     
  • Duncan McGreggor

    Logged In: YES
    user_id=462533

    I have done some more testing on the logging, and it seems
    to be working well. I set different values in the .ini file
    to affect both the logging and the caching, with expected
    (good) reslts.

     

Log in to post a comment.