Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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
 
A timing clock, fuse wire, high explosives and a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic