Logging: unfancy plain text handler

K

Karsten Wutzke

Hi all!

Does anyone have a plain text handler for the Logger class, that is, a
kind of like the delivered FileHandler, just without all this fancy
date/time and class origin, line number stuff? Just a simple FileHandler
that puts the logged strings into a file as is, without any additional
stuff?

I think I've asked this some time ago when the new logging package was
available, but I didn't get any answers.

I'd very much appreciate if someone has one or knows where to get the
code for it.

Thanks!
Karsten
 
B

Boris Stumm

Karsten said:
Does anyone have a plain text handler for the Logger class, that is, a
kind of like the delivered FileHandler, just without all this fancy
date/time and class origin, line number stuff? Just a simple FileHandler
that puts the logged strings into a file as is, without any additional
stuff?

handler.setFormatter(new Formatter() {
public String format(LogRecord l) {
return l.getMessage();
}
});

Not tested, but you get the idea.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top