You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Vlad GURDIGA <gu...@gmail.com> on 2009/07/26 19:16:27 UTC

show request

Hello!

Is there any documentation on the structure of the "req" parameter
given to shows? (The scripts in the /shows/ directory)

Thank you!

Re: show request

Posted by Vlad GURDIGA <gu...@gmail.com>.
Mystery solved. :)

The reason why I did not see the logged message in the log was that
the show was cached and I simply got a HTTP 304  response.

AFAICS, the show was simply not executed although was changed (yes, I
have uploaded my changes with "couchapp push").

RE: show request

Posted by Nils Breunese <N....@vpro.nl>.
That depends on how you're running CouchDB. I run CouchDB as a daemon using the supplied startup script, so it's logging to a file, but you could be running it directly from the command line and get your output on the console.

Nils Breunese.
________________________________________
Van: Vlad GURDIGA [gurdiga@gmail.com]
Verzonden: zondag 26 juli 2009 22:11
Aan: user@couchdb.apache.org
Onderwerp: Re: show request

On Sun, Jul 26, 2009 at 10:40 PM, Paul Davis<pa...@gmail.com> wrote:

> And that'll print to where ever couchdb happens to be logging.

And this is my case would be the console. Right?

De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mail, noch voor tijdige ontvangst daarvan.

Re: show request

Posted by Chris Anderson <jc...@apache.org>.
On Sun, Jul 26, 2009 at 1:11 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
> On Sun, Jul 26, 2009 at 10:40 PM, Paul Davis<pa...@gmail.com> wrote:
>> Vlad,
>>
>> I meant in your show function you can log messages like such:
>>
>> function(doc, req)
>> {
>>    log(req);
>> }
>
> Right.
> And that's exactly what I did.
>

Logging should show up at level info and higher. I'm not sure why it's
not working for you. The lines should be in the log output.

There are also some assertions in the show_documents.js test suite
file that probe the req object.

Chris


>>
>> And that'll print to where ever couchdb happens to be logging.
>
> And this is my case would be the console. Right?
>
>>
>> On Sun, Jul 26, 2009 at 2:38 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
>>> I'm using CouchDB build from the trunk source, so it logs to the console.
>>>
>>> I've added the "log(req)" and set the log level in local.ini to
>>> "debug", but I do not see anything about the req in the log, just
>>> headers, and records like these:
>>>
>>> [info] [<0.52.0>] 127.0.0.1 - - 'GET' /s1/_design/s1/_show/book 200
>>> [debug] [<0.72.0>] 'GET' /_utils/script/json2.js {1,1}
>>>
>>>
>>> I guess I need to look somewhere else or to switch something else on/off.
>>>
>>> Is this "log" function (and maybe other such goodness) documented somewhere?
>>>
>>>
>>> Thanks a lot!
>>>
>>> On Sun, Jul 26, 2009 at 9:05 PM, Paul Davis<pa...@gmail.com> wrote:
>>>> Not sure about documentation, but its a JSON representation of the
>>>> HTTP request. You can try using the log() function to print it to the
>>>> CouchDB log.
>>>>
>>>> Paul Davis
>>>>
>>>> On Sun, Jul 26, 2009 at 1:16 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
>>>>> Hello!
>>>>>
>>>>> Is there any documentation on the structure of the "req" parameter
>>>>> given to shows? (The scripts in the /shows/ directory)
>>>>>
>>>>> Thank you!
>>>>>
>>>>
>>>
>>
>



-- 
Chris Anderson
http://jchrisa.net
http://couch.io

Re: show request

Posted by Vlad GURDIGA <gu...@gmail.com>.
On Sun, Jul 26, 2009 at 10:40 PM, Paul Davis<pa...@gmail.com> wrote:
> Vlad,
>
> I meant in your show function you can log messages like such:
>
> function(doc, req)
> {
>    log(req);
> }

Right.
And that's exactly what I did.

>
> And that'll print to where ever couchdb happens to be logging.

And this is my case would be the console. Right?

>
> On Sun, Jul 26, 2009 at 2:38 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
>> I'm using CouchDB build from the trunk source, so it logs to the console.
>>
>> I've added the "log(req)" and set the log level in local.ini to
>> "debug", but I do not see anything about the req in the log, just
>> headers, and records like these:
>>
>> [info] [<0.52.0>] 127.0.0.1 - - 'GET' /s1/_design/s1/_show/book 200
>> [debug] [<0.72.0>] 'GET' /_utils/script/json2.js {1,1}
>>
>>
>> I guess I need to look somewhere else or to switch something else on/off.
>>
>> Is this "log" function (and maybe other such goodness) documented somewhere?
>>
>>
>> Thanks a lot!
>>
>> On Sun, Jul 26, 2009 at 9:05 PM, Paul Davis<pa...@gmail.com> wrote:
>>> Not sure about documentation, but its a JSON representation of the
>>> HTTP request. You can try using the log() function to print it to the
>>> CouchDB log.
>>>
>>> Paul Davis
>>>
>>> On Sun, Jul 26, 2009 at 1:16 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
>>>> Hello!
>>>>
>>>> Is there any documentation on the structure of the "req" parameter
>>>> given to shows? (The scripts in the /shows/ directory)
>>>>
>>>> Thank you!
>>>>
>>>
>>
>

Re: show request

Posted by Paul Davis <pa...@gmail.com>.
Vlad,

I meant in your show function you can log messages like such:

function(doc, req)
{
    log(req);
}

And that'll print to where ever couchdb happens to be logging.

On Sun, Jul 26, 2009 at 2:38 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
> I'm using CouchDB build from the trunk source, so it logs to the console.
>
> I've added the "log(req)" and set the log level in local.ini to
> "debug", but I do not see anything about the req in the log, just
> headers, and records like these:
>
> [info] [<0.52.0>] 127.0.0.1 - - 'GET' /s1/_design/s1/_show/book 200
> [debug] [<0.72.0>] 'GET' /_utils/script/json2.js {1,1}
>
>
> I guess I need to look somewhere else or to switch something else on/off.
>
> Is this "log" function (and maybe other such goodness) documented somewhere?
>
>
> Thanks a lot!
>
> On Sun, Jul 26, 2009 at 9:05 PM, Paul Davis<pa...@gmail.com> wrote:
>> Not sure about documentation, but its a JSON representation of the
>> HTTP request. You can try using the log() function to print it to the
>> CouchDB log.
>>
>> Paul Davis
>>
>> On Sun, Jul 26, 2009 at 1:16 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
>>> Hello!
>>>
>>> Is there any documentation on the structure of the "req" parameter
>>> given to shows? (The scripts in the /shows/ directory)
>>>
>>> Thank you!
>>>
>>
>

Re: show request

Posted by Vlad GURDIGA <gu...@gmail.com>.
I'm using CouchDB build from the trunk source, so it logs to the console.

I've added the "log(req)" and set the log level in local.ini to
"debug", but I do not see anything about the req in the log, just
headers, and records like these:

[info] [<0.52.0>] 127.0.0.1 - - 'GET' /s1/_design/s1/_show/book 200
[debug] [<0.72.0>] 'GET' /_utils/script/json2.js {1,1}


I guess I need to look somewhere else or to switch something else on/off.

Is this "log" function (and maybe other such goodness) documented somewhere?


Thanks a lot!

On Sun, Jul 26, 2009 at 9:05 PM, Paul Davis<pa...@gmail.com> wrote:
> Not sure about documentation, but its a JSON representation of the
> HTTP request. You can try using the log() function to print it to the
> CouchDB log.
>
> Paul Davis
>
> On Sun, Jul 26, 2009 at 1:16 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
>> Hello!
>>
>> Is there any documentation on the structure of the "req" parameter
>> given to shows? (The scripts in the /shows/ directory)
>>
>> Thank you!
>>
>

Re: show request

Posted by Paul Davis <pa...@gmail.com>.
Not sure about documentation, but its a JSON representation of the
HTTP request. You can try using the log() function to print it to the
CouchDB log.

Paul Davis

On Sun, Jul 26, 2009 at 1:16 PM, Vlad GURDIGA<gu...@gmail.com> wrote:
> Hello!
>
> Is there any documentation on the structure of the "req" parameter
> given to shows? (The scripts in the /shows/ directory)
>
> Thank you!
>