Skip to content

PM2 logging configuration for JSON format #2663

@nidhhoggr

Description

@nidhhoggr

With the latest version of PM2 there is the ability to output all logs in JSON with the following command:

pm2 logs --json

PM2 already writes all the log in the ~/.pm2/logs folder respectively. The issue is, the format
of these logs are not in JSON and it seems there is no option in the configuration to force the
format of the output to be JSON instead.

Is there something in the documentation I am missing?

A work around is writing a deamon to spawn individual processes and redirect all STDOUT of pm2 logs [app_name] --json to ~/.pm2/logs/[app_name]-[process_id]-[type].log I am hoping that something is built in PM2 to care on this instead.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions