Hey I have problem with output the date format from log4j property in terminal.
Here's part from the prop. file:
log4j.rootLogger=INFO, CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Target=System.err
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n
and the output in Eclipse is: 2013-06-10 14:38:21,478 INFO
but in terminal, where I expect the same output it's 13/06/10 14:38:21 INFO
So any ideas how can i have the same output as the one in Eclipse, is it from the log4j property file or?
Thanks in advance! :)
Try like this way.
log4j.appender.CONSOLE.DatePattern=%d{yyyy-MM-dd HH:mm:ss,SSS}
log4j.appender.CONSOLE.layout.conversionPattern=%m%n
set separately DatePattern
and conversionPattern
i thing it ll helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With