0

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
Thijs
  • 1,423
  • 15
  • 38

1 Answers1

1

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.

David Thomas
  • 2,264
  • 2
  • 18
  • 20
  • Thanks, and I supposedly need to set the development mode after every update. How do you deploy a new version? I package it and upload the zip in the web interface but it's cumbersome! – Thijs Apr 14 '17 at 13:31
  • 1
    Ah, yes, I use WebStorm installed on the Ubuntu server (virtual machine) that hosts ArangoDB. I have auto deployment set up in WebStorm so every time you save any file, it copies the whole APP folder I'm working on into the target location. When you turn on Development mode, you'll see the path to the Foxx app on the API tab. Then you can use git or something to save your APP as you're working on it.. and WebStorm (or any other IDE that supports auto deployments) can copy it to the live location for instant, no bother testing. – David Thomas Apr 14 '17 at 13:35
  • Do you really debug your foxx app using console.log and take a look in the LOGS menu ? I feel like a var_dump in php ten years ago. Is there more decent way to debug a foxx app ? – ManUtopiK Mar 19 '18 at 22:18
  • 1
    @ManUtopiK I tail the log file for ArangoDB. Soon there are updates coming to the product to assist with topics etc to log streams, but yes, for now it's logging. Really, when developing software, it's not been a problem, even with thousands of lines of foxx code over many files. – David Thomas Mar 20 '18 at 11:06