tags:

views:

55

answers:

3

I have a question but not sure it is possible or not.

I am using apache logger for my logging which creates a log file which works fine with no issues. My question is when I open the log file I get the different messages like messages with INFO,DEBGU,ERROR etc.

But I want to see the error message in red color in text in my logger file. Is this possible? That way, if someone opens my log file and something is there in red they can clearly guess that it is an error message..

Is this possible?

I would really appreciate if someone can respond.

Thanks, Swati

A: 

Which text editor do you use to open the log file? Notepad, Notepad++, UltraEdit, SlickEdit, or one of the many, many text editors out there? By default, you can't. There might some text editors that allows you to write some kind of extension or plugin to provide custom syntax highlighting. That's an option you take.

Having said that, if some one else open using his/her text editor, and without your plugin, they of course won't see the red color coded lines.

Khnle
A: 

I'll be honest and say I know nothing about the apache logger you're talking about.

Log files are typically plain text, purely for the reason that other programs can parse them. Will you use HTML, or RTF to markup the log? If so, what happens if you have a programmer like me who does not care about formatting?

Short Answer: yes it's possible.

Long Answer: but you'll have to add the appropriate markup, and you'll have to assume the user has the correct application to view said markup. In the end, this might cause more problems than its worth: If your end user is a programmer reading the log file, then formatting is usually superfluous. If your end user is a normal non-technical person, consider other means of notifying them of errors.

Charlie Salts
A: 

You could just use a logviewer.

devSpeed
I'm not 100% certain, but I think the OP is using the org.apache.log4j class, not the Apache web server. In this case, the OP is *generating* logs, in addition to *viewing* them.
Charlie Salts