log with timbre in clojure: how to set timestamp and local?

758 Views Asked by At

I have the following code.

   (timbre/merge-config! {:timestamp-pattern "yyyy/MM/dd HH:mm:ss ZZ" } )
 (info (str "acm template deploy start..., the version is " version))

But the timestamp format is not I want. How should I set the format?

 $ lein run
Compiling com.rockiedata.dw.acm.template.deploy
15-Jun-25 22:13:00 UnknownHost INFO [com.rockiedata.dw.acm.template.deploy] - acm template deploy start..., the version is 0.1

And also how to set local, in the document it said

  :timestamp-locale  nil

But how to set a Chinese local?

1

There are 1 best solutions below

0
Viktor K. On BEST ANSWER

Based on the documentation https://github.com/ptaoussanis/timbre you should do following :

(timbre/merge-config! 
  {:timestamp-opts 
    {:pattern "yyyy/MM/dd HH:mm:ss ZZ" 
     :locale (java.util.Locale. "zh_CN")}})