Re: Log is full with redirection messages...

Durumdara <[email protected]>
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
Hi!

Thanks for your idea.
I found the base of the error.
In the beginings I don't know mod_python good, and I handle the errors in my
way:

try:
    DoProcess
except:
    if DevelopMode:
       raise
    else:
       LogToApache(GetLastError)

I changed this in every site to DebugMode = Off /On way, but in this I
forget to do...
Because in the first time I don't know about DebugMode's "Log error to the
apache logs only" effect.


If I simplified to:

DoProcess

and to DebugMode (On/Off)

the redirection messages are vanished...

This happening with me many times, because I develop many thing that is
already in the systems, only I do not read the F* manual fully... :-)

See "req.construct()" is in my older way:
        self.FullURL = 'http://' + self.Request.hostname + '' +
self.Request.unparsed_uri
        self.FullURLNoArgs = 'http://' + self.Request.hostname + '' +
self.Request.uri

:-)

Thanks for your help:
   dd

2009/3/31 Graham Dumpleton <[email protected]>

> 2009/3/31 Durumdara <[email protected]>:
> > Hi!
> > Please suggest me some tips, how to avoid this effect.
> > I have a "shop" that have "items".
> > When item purchased without problems, I redirect the user to the page to
> > avoid F5/Refresh effect and to show some "success" message.
> > When some item not existing, I redirect the user to the page "Does not
> > exists!".
> > I do this with:
> >    util.redirect(R.Request, './page.ptml', 1)
>
> The second argument to util.redirect() must be a proper URL, inclusive
> of 'http://host' to work properly. Some browsers may work if absolute
> path for same site, but not guaranteed. Definitely should not be a
> relative path.
>
> So, use an absolute URL path and pass it through req.construct_url()
> to have appropriate 'http://host' added at the front.
>
>  util.redirect(R.Request,
> req.construct_url('/some/absolute/url/page.ptml'), 1)
>
> Graham
>
> > Because of this, the error log is full with "non-error" elements, and it
> is
> > hard to find the real errors.
> > The web spiders uses caches, and steps to many items that "vanished now",
> so
> > my is log is 95% of redir messages.
> > Please help me a little: how to redirect them without error messages, and
> > how to make 404 or other error without see the silent exception in the
> log?
> > Thanks for your help:
> >    dd
> >
> >
> >
> > _______________________________________________
> > Mod_python mailing list
> > [email protected]
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
> >
>

_______________________________________________
Mod_python mailing list
[email protected]
http://mailman.modpython.org/mailman/listinfo/mod_python
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.