Systemd 仅记录 3 行错误

Systemd 仅记录 3 行错误

我在运行命令时出错

assert.js:81
  throw new assert.AssertionError({
  ^
AssertionError: APP_API env var not set
    at Object.<anonymous> (/opt/offero-html-server/src/routes/offer.js:13:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

其中journalctl -u my-service得到以下输出

44:44 offero-web systemd[1]: my-service.service: Service hold-off time over, scheduling restart.
Jun 29 11:44:44 user-web systemd[1]: Stopped offero-html-server.service.
Jun 29 11:44:44 user-web systemd[1]: Started offero-html-server.service.
Jun 29 11:44:45 user-web my-service[17748]: assert.js:81
Jun 29 11:44:45 user-web my-service[17748]:   throw new assert.AssertionError({
Jun 29 11:44:45 user-web my-service[17748]:   ^
Jun 29 11:44:45 user-web systemd[1]: my-service.service: Main process exited, code=exited, status=1/FAILURE
Jun 29 11:44:45 user-web systemd[1]: my-service.service: Unit entered f

如何查看未截断的输出?

答案1

journalctl --no-page这样做,但显然不适用于单个单位。

相关内容