Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
任何人都可以告诉我如何将输出trace_gc重定向到节点js中的日志文件而不是控制台我给了这样的命令
node -trace_gc -trace_gc_verbose example.js
并给我一个 node.js 的示例 gc 日志文件
如果您不需要将应用程序本身的输出与 gc 跟踪分开,您可以简单地使用以下命令重定向输出:
node -trace_gc -trace_gc_verbose example.js > output.log
否则 V8 有一个--log_gc输出到日志文件的选项(可以用定义,--logfile但这似乎没有输出有很多信息,如-trace_gc.
--log_gc
--logfile
-trace_gc
查看node --v8-options所有选项
node --v8-options