1

With couch db _util (Fauxton Utility) i did create view as follows

function (doc) {
  console.log(doc.biodatas.length);
   if(doc.biodatas.length > 0) {
    for(var idx in doc.biodatas) {
      console.log(idx);
      emit(idx.Name,idx.Surname,idx.City,idx.Phone);
    }
  }
}

i did create this view for display data as row order for suggested Name,Surname,City and Phone info of document. but i did not seen any result no document found was the result. but i have inserted data in the document. to debug that and find out whats wrong i did write console.log with in code but still in browser developer console nothing is getting display. i did also open CouchDB\var\log `s couchdb.log file but there is no message just server's request status record. and actually this file is too big to find logs. is there any other way to sore log records of specific view in different file?.

Community
  • 1
  • 1
Nisarg Desai
  • 361
  • 3
  • 16
  • 1
    Possible duplicate of [How to console log in couchdb](https://stackoverflow.com/questions/9612615/how-to-console-log-in-couchdb) – Alexis Côté May 24 '17 at 12:39
  • I did seen couch.log file there was nothing there. its have request report that which request got response successfully or failed. – Nisarg Desai May 24 '17 at 12:42
  • 1
    As mentioned in the stackoverflow link, CouchDB expose a [log](http://docs.couchdb.org/en/2.0.0/query-server/javascript.html#log) function that let you log messages to couch.log. It's **NOT** *console.log()* but simply **log()** – Alexis Côté May 24 '17 at 12:51
  • 1
    Also, you can change the log level of CouchDB or per module to hide unwanted log messages. See http://docs.couchdb.org/en/2.0.0/config/logging.html – Alexis Côté May 24 '17 at 12:54
  • i am using windows machine in my system d:\CouchDB\var\log folder contain couchdb.log file in that nothing is getting logged. – Nisarg Desai May 24 '17 at 13:04
  • okay it was issue with Fauxton view was not getting saved and responding with 401 unauthorized access. so not getting logged as old console.log was not replaced and saved. now i am able to see my logs. is there anyway to log different level of info in different files ? – Nisarg Desai May 24 '17 at 13:12
  • As I mentioned, you can do per-module log level. I don't know what is the specific view module but I guess that if you lookup into the project sources, you could be able to find it. – Alexis Côté May 24 '17 at 13:21
  • 1
    Anyways i think i will manage that by adding --------------------- . anyways thanks @Alexis Cote i really appreciate that. – Nisarg Desai May 24 '17 at 13:26

0 Answers0