Velocity formatted timestamp in springboot

  springboot

toolbox.xml

<toolbox>
    <tool>
        <key>date</key>
        <scope>application</scope>
        <class>org.apache.velocity.tools.generic.DateTool</class>
        <parameter name="format" value="yyyy-MM-dd HH:mm:ss"/>
    </tool>
</toolbox>

References in vm

$!date.format($!log.timestamp)

Configure the location of toolbox

spring:
  velocity:
    charset: UTF-8
    properties:
      input:
        encoding: UTF-8
      output:
        encoding: UTF-8
    toolbox-config-location: toolbox.xml

docs