Why does log file name contain an unexpected value when rotatelogs is used with %m in a Systemd.unit file?

Solution Verified - Updated -

Issue

If rotatelogs is used in a Systemd Unit file as below, the logfile name will be console.log.2020-c7af614bc30244619c4ee8ff60053d28-10. Why does the log file name contain an unexpected value when rotatelogs is used with %m (minute) in a Systemd.unit file?

ExecStart=/bin/sh -c "/opt/jboss-eap-7.3/bin/standalone.sh | /usr/sbin/rotatelogs -l /var/log/jboss-eap/console.log.%Y-%m-%d 86400"

Environment

  • Red Hat Enterprise Linux (RHEL)
    • 7
  • rotatelogs

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content