简体   繁体   English

Foxx服务记录

[英]Foxx service logging

Following the documentation, it should be possible to log from a Foxx service. 按照文档,应该可以从Foxx服务登录。 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) https://docs.arangodb.com/2.8/Foxx/Develop/Console.html (看起来这是旧版本,而文档中缺少新版本)

In my script is a console.info("this is a test"); 在我的脚本中是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. 我找不到_foxxlog集合,不确定它应该在哪里以及什么用户应该具有访问权限。 There is a log page in the admin interface of Arango but it is not there. 在Arango的管理界面中有一个日志页面,但那里没有。

The documentation reads: As the log entries are logged to a collection in the database, you can easily query them in your own application. 该文档的内容如下: 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. 找到了foxx-manager应用程序(命令行功夫),它具有选项development ,但没有帮助,因此完全是猜测。 This didn't work at first but now I added --server.database <mydb> to it this command executes fine. 最初这没有用,但是现在我在它上添加了--server.database <mydb> ,此命令可以正常执行。 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? 这是我的Foxx服务的挂载点吗? 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"); 创建一个包含console.info("test");的服务console.info("test");
  2. Activate development mode with foxx-manager development --server.database <db> <service mount> 使用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. 登录到ArangoDB UI,选择数据库,然后单击LOGS菜单项,您将在选项卡上看到列出的日志,并且您的日志记录就在其中。

I'm not sure about other ways to access the logs, but I use the LOGS menu. 我不确定其他访问日志的方法,但是我使用LOGS菜单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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