Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Date Time not showing up

 
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
i am new to log4j, i have following properties file
log4j.rootLogger=DEBUG,A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.MaxFileSize=10KB
log4j.appender.A2.MaxBackupIndex=10
log4j.appender.A2.layout=org.apache.log4j.HTMLLayout
log4j.appender.A2.File=C:\\log\\ErrorLog.html
log4j.logger.log=DEBUG

I am not getting time on my html page generated by log4j, instead it is showing something like 10,20 etc
although it is showing the time when application was started, but not for every entry made in the log.
can anybody tell me why it is happening like this and whats the solution.
thanx
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
try to add the following line to your config:
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

this should provide you a message of the following way:
2000-09-07 14:07:41,508 [main] INFO MyApp - Entering application
Bye
Olli
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!