Foxx 服务日志记录

Foxx service logging

根据文档,应该可以从 Foxx 服务登录。 https://docs.arangodb.com/2.8/Foxx/Develop/Console.html (看起来这是针对旧版本的,而在文档中缺少新版本)

在我的脚本中有一个 console.info("this is a test"); 但它去哪里了,我该如何阅读它?

我找不到 _foxxlog 集合,不确定它应该在哪里以及什么用户应该有访问权限。 Arango的管理界面有日志页面,但是没有。

文档内容如下:As the log entries are logged to a collection in the database, you can easily query them in your own application. 什么数据库中的什么集合,如果我查看所有这些,任何地方都没有日志记录集合。

更新

找到了 foxx-manager 应用程序,命令行功夫,它有一个选项 development 帮助中没有,所以这都是猜测。 起初这不起作用,但现在我向其中添加了 --server.database <mydb> 此命令执行正常。仍然不知道日志数据在哪里。

命令结果

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

这是我的 Foxx 服务的挂载点吗?这是我应该能够找到日志数据的新点吗?都试过了,还是不行。 现在我登录到一个我不知道的地方,然后我在某个地方激活了一些挂载点?!

结论

  1. 创建包含 console.info("test");
  2. 的服务
  3. 使用 foxx-manager development --server.database <db> <service mount>
  4. 激活开发模式
  5. 使用日志菜单
  6. 更新后重新激活开发模式

登录到 ArangoDB UI,select 您的数据库,然后单击“日志”菜单项,您将看到跨选项卡列出的日志,您的日志记录就在那里。

我不确定访问日志的其他方式,但我使用日志菜单。