couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
Subject Re: logging from views
Date Sun, 25 May 2008 13:37:20 GMT
On 25.05.2008, at 15:05, Noah Slater wrote:
> On Sat, May 24, 2008 at 04:31:33PM -0700, Chris Anderson wrote:
>> The only thing I'm not sure of is couchjs.tpl.in
>
> Yes, I'm not happy with that as it stands.
>
> Perhaps if this was to go forward I could add a "-l" option to  
> specify a log
> file to write out STDERR. You could then specify this option in the  
> INI file.
>
> I don't know if this would work with the way Erlang invokes couchjs.
>
> Chris, what do you think?

There's already a simple (but incomplete) provision for logging from  
the view server: you print a JSON-encoded line such as the following  
to stdout:

   {"log": "bla bla"}

CouchDB will take that and write it to its own log output (at INFO  
level).

The Javascript view server (share/server/main.js) uses this to log  
error messages. We could simply make this functionality available  
through a `log(message)` function that would be made available inside  
views.

Cheers,
--
Christopher Lenz
   cmlenz at gmx.de
   http://www.cmlenz.net/


Mime
View raw message