+ Reply to Thread
Results 1 to 7 of 7

Thread: Script error logs?

  1. #1
    meithan is offline x10Hosting Member meithan is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    13

    Script error logs?

    Hi.

    Is there a way to see the server logs to debug my scripts? It's very annoying that I only get an "Internal Server Error" and no other indication whatsoever of what's going on.

    I'm programming in Python, which has a facility for cgi script debugging (cgitb), but it only kicks in when the scripts run up to a certain point. If I could see the server log produced when the scripts runs, it would make debugging much easier.

    Thanks.

  2. #2
    dlukin is offline x10 Lieutenant dlukin is on a distinguished road
    Join Date
    Oct 2009
    Posts
    427

    Re: Script error logs?

    cPanel --> Logs --> Error log

    Not always very informative.

    Either

    import cgitb; cgitb.enable()

    OR (for debugging only, not production)

    import sys
    sys.stderr = sys.stdout
    print "Content-Type: text/plain"
    print ""

    will at least put the line number of the error in the error log.

  3. #3
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Script error logs?

    It's best to develop on your own server, where you have more control. You can use remote debugging to debug programs interactively.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  4. #4
    meithan is offline x10Hosting Member meithan is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    13

    Re: Script error logs?

    Quote Originally Posted by dlukin View Post
    cPanel --> Logs --> Error log

    Not always very informative.

    Either

    import cgitb; cgitb.enable()

    OR (for debugging only, not production)

    import sys
    sys.stderr = sys.stdout
    print "Content-Type: text/plain"
    print ""

    will at least put the line number of the error in the error log.
    Thanks, that was informative! I'll try those methods. I spent one hour this morning searching for a bug. It was a missing ' mark in one line.

    Quote Originally Posted by misson View Post
    It's best to develop on your own server, where you have more control. You can use remote debugging to debug programs interactively.
    I don't have my own server, that's why I'm on x10hosting ;)

  5. #5
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Script error logs?

    X10 is your production server. You should set up a development server (not publicly accessible) by installing a web server and DBMS. XAMPP runs on most platforms and includes most things you'll need. Another all-in-one package for MS Windows platforms is WampServer.
    Last edited by misson; 06-12-2010 at 10:54 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  6. #6
    meithan is offline x10Hosting Member meithan is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    13

    Re: Script error logs?

    Quote Originally Posted by misson View Post
    X10 is your production server. You should set up a development server (not publicly accessible) by installing a web server and DBMS. XAMPP runs on most platforms and includes most things you'll need. Another all-in-one package for MS Windows platforms is WampServer.
    I was thinking that's what you meant: running a webserver on my own machine to do testing. It's a fabulous idea. Learning to use Apache will certainly be useful. I run Linux, so I'll look into the XAMPP package you suggested. Thanks for the tip!

  7. #7
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Script error logs?

    Apache might be part of the default install for your distro. You can also use the package manager for you distro to install the various programs. XAMPP for Linux makes things a little easier by installing and letting you start/stop/restart everything at once and by having a useful default configuration, but you still have to make configuration changes by hand.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. error logs not showing errors
    By sirduncan in forum Free Hosting
    Replies: 0
    Last Post: 09-25-2008, 03:07 PM
  2. Raw Logs
    By rulcas in forum Soporte
    Replies: 2
    Last Post: 07-01-2008, 02:18 PM
  3. Delete Error Logs script error D:
    By Shadow121 in forum Programming Help
    Replies: 0
    Last Post: 06-29-2008, 08:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers