> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/javascript-node-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/javascript-node-js/chapter2-nodejs/23nodejs-debug-message/231allow-nodejs-server-to-output-log.md).

# 2.3.1.Allow node.js server to output log

* 1.sudo npm install debug -save
* 2.var debug = require('debug')('app');
* 3.添加debug message: debug('booting');
* 4.在命令列中執行: export DEBUG=app
* 5.在命令列中執行: node app.js
