简体   繁体   中英

Foxx service logging

Following the documentation, it should be possible to log from a Foxx service. https://docs.arangodb.com/2.8/Foxx/Develop/Console.html (looks like this is for an old version and missing in doc for newer versions)

In my script is a console.info("this is a test"); but where does this go and how do I read it?

I cannot find the _foxxlog collections, not sure where it should be and what user should have access rights. There is a log page in the admin interface of Arango but it is not there.

The documentation reads: As the log entries are logged to a collection in the database, you can easily query them in your own application. What collection in what database, and if I look at all of them, there is no logging collection, anywhere.

update

Found the foxx-manager applicatoin, command-line kung-fu, and it has an option development which is not in the help so it's all a guess. This didn't work at first but now I added --server.database <mydb> to it this command executes fine. Still clueless where the log data is.

Command result

Activated development mode for Service undefined version undefined on mount point /geo

Is this the mount point of my Foxx service? Is this a new point where I should be able to find the log data? Have tried it all, still nothing. Now I log to somewhere I don't know and I activate some mount point somewhere?!

conclusion

  1. Create a service containing console.info("test");
  2. Activate development mode with foxx-manager development --server.database <db> <service mount>
  3. Use Logs menu
  4. Re-activate development mode after update

Log into the ArangoDB UI, select your database, and click on the LOGS menu item, you will see the logs listed across the tabs and your logging is in there.

I'm not sure about other ways to access the logs, but I use the LOGS menu.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM