简体   繁体   English

如何在Parse Dashboard Logs View中显示日志

[英]How to show logs in Parse Dashboard Logs View

The Parse Dashboard has a Logs view that should show Logs that Parse produces. Parse Dashboard有一个Logs视图,应该显示Parse生成的Logs。

Currently all we're getting is the LiveQuery started logs and no errors. 目前我们得到的只是LiveQuery启动日志而没有错误。 So we know the logs can be read but not how to tell Parse to log them here. 所以我们知道可以读取日志但不知道如何告诉Parse在这里记录它们。

I've searched online for the Docs for this feature but they don't seem to exist. 我在网上搜索了这个功能的文档,但它们似乎不存在。

Could someone point out how to get Logs to show here, and what logs can be shown here. 有人可以指出如何在这里显示日志,以及可以在这里显示的日志。 ie: Is it just cloud code logs? 即:它只是云代码日志吗? Can Node logs be directed here? 节点日志可以在这里定向吗?

Any examples or links to the docs would be greatly appreciated. 任何示例或文档链接将不胜感激。

Running Parse Dashboard v 1.0.19. 运行Parse Dashboard v 1.0.19。

Anything that is logged using the the parse logger should show up in your dashboard logs (they do for me!). 使用解析记录器记录的任何内容都应显示在仪表板日志中(它们适用于我!)。

So, some things to know: 所以,有些事要知道:

  1. only things logged with the logger in ParseServer will appear there. 只有在ParseServer中使用记录器记录的内容才会出现在那里。 Stdout and Stderr are not redirected to the log. Stdout和Stderr不会重定向到日志。 So if you use console.log() , they will not show up in the logs. 因此,如果您使用console.log() ,它们将不会显示在日志中。
  2. If parse-server generates an error, it should be logged and show up in the dashboard. 如果parse-server生成错误, 则应记录该错误并显示在仪表板中。 I am not that familiar with the LiveQuery feature and it is possible that there is a path where an error is produced but not logged. 我不熟悉LiveQuery功能,并且可能存在生成错误但未记录错误的路径。 If you can tell me how to reproduce and its a logging error, I'll fix it :). 如果你能告诉我如何重现和它的日志记录错误,我会解决它:)。
  3. To log something, you can either: 要记录某些内容,您可以:

const logger = require('parse-server').logger;
logger.warn('this is a log message', { foo: 'bar' });

or, in cloud code, you can use the logger on the request object: 或者,在云代码中,您可以在请求对象上使用记录器:

 Parse.Cloud.define('cloudFunctionName', (request, response) => {
    request.log.warn('this is a log message!');
 });

In general, parse-server is pretty quiet. 通常,解析服务器非常安静。 You can make it chatty by setting the environment variable VERBOSE=1 您可以通过设置环境变量VERBOSE=1来使其变得健谈

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

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