This content has been marked as final. Show 17 replies
None of the examples in the log4j documentation suggest anything?
i did a google search and could not find any info.
Amazing. Link to the log4j documentation (first link that comes up when you put those two words into Google):
Load that. Use Control-F in your browser to search for the word "Date".
Dear Dr..... The link is fine. I am aware of all the links u were talinkg about.
Pl answer to my question that I could not find in the link u had published here.
Well, I'm sorry. If you are going to work in this business you will need to be able to find information from text documents. Are you seriously telling me that even after I told you precisely where to find the information, you still couldn't read it?
In fact I have already referred to the link, before I post in the forum.
I do not find any where in the document how can I write the property to display in date and time format instead of millisecond.
I understand what you mean.
Appreciate if you can write a line of code to fix this problem.
Thanks in advance
i am stuck for an answer from an expert.
You got a perfectly good one. I'm staring directly at the answer you're looking for, you just need to read far enough down the page, and follow the advice that has already been given to you.
i know how to do it.
it has something to do with output format, you should probably check in the documentation how to use their output format strings to accomplish what you need.
Thanks for the posts.
I see the documentation again and could not locate the line you all are referring.
Can any one of you just copy and paste the line here?
If you had used Control-F in your browser to search for the word "Date", pressing it twice would have landed you on this line:
# Print the date in ISO 8601 formatNow, that isn't the line you need. It's a comment. But you should be able to find the line you do need quite close to it.
If you had used Control-F in your browser to searchAnd I'll bet he'll copy and paste that exact line instead of adapting it to fit the appender name he is configuring.
for the word "Date", pressing it twice would have
landed you on this line:
# Print the date in ISO 8601 format
Now, that isn't the line you need.
It's a comment. But you should be able to find the
line you do need quite close to it.
Thanks for the reply.
I am getting the following error message and the Html file still displaying milliseconds.
########## HTML appender properties ############## log4j.appender.htmlIn=org.apache.log4j.RollingFileAppender log4j.appender.htmlIn.File=/app/data/nas/lynx/log/LynxInLogger.html log4j.appender.htmlIn.layout=org.apache.log4j.HTMLLayout log4j.appender.htmlIn.layout.LocationInfo=true log4j.appender.htmlIn.layout.ConversionPattern=%d %-5p %c - %m%n log4j.appender.htmlIn.layout.Title=Lynx Interpretations Log ########## End HTML appender properties ###########
log4j:WARN No such property [conversionPattern] in org.apache.log4j.HTMLLayout.
Appreciate review and help by Gurus.....
Message was edited by:
Message was edited by:
The referenced examples are using PatternLayout not HTMLLayout.
PatternLayout and HTMLLayout are not the same thing.
And HTMLLayout doesn't derive from PatternLayout.
Not even sure that makes sense. PatternLayout is intended to produce a single line and really just one string from the event. That wouldn't seem to make sense in html.
I would suspect that this would require some custom work. Although there might be some clever configuration that one could do.