Proxy stdin to the systemd socket to avoid the line length limit.
See:
- Bug 86465 - journal logs from service stdout/stderr split at 2048 chars
- Github: stuart-warren/bigjournallogs
Note: All messages get sent to journald with a priority of 'NOTICE' as we use the priority in the message for our logging.
Use in your systemd unit file with
[Unit]
Description=my-service
[Service]
ExecStart=/bin/npm start | /bin/journald-proxy
WorkingDirectory=/opt/my-service
Restart=always
RestartSec=10
User=webapp
EnvironmentFile=-/etc/sysconfig/my-service
[Install]
WantedBy=multi-user.target