Search code examples
node.jsdockerloggingloopbackjs

Enabling timestamp in NodeJS (loopback) Logs


I have a nodeJS loopback application running in a Docker Container.

When I monitor the logs there is no timestamp for the logs, resulting in obvious challenges.

Is there a way to enable timestamps for these logs?

Thanks

enter image description here


Solution

  • Turned out I just needed to add the -t option.

    So..

    docker service logs -ft {NAME_OF_THE_SERVICE}
    

    Will output the logs with the tstamp included in the output