On Tue, 2004-01-27 at 18:43, Sheward, Barry wrote:
> Hi,
>
> We use Log4J extensively and find that sometimes we always want to log a message,
> but the message is simply for informational purposes. Using
> Logger/Category.fatal() would potentially frighten users,
You could use a custom Level which has a "value" higher than FATAL but
is labeled as "INFO" or whatever.
public interface CustomLevel
{
int ALWAYS_INT = Level.ALL_INT;
Level ALWAYS = new Level(ALWAYS_INT, "INFO", 7);
}
Logger.log(CustomLevel.ALWAYS, "message");
I'm surprised this pattern isn't used more often...
You might find better names than "ALWAYS". Of course, if the category
itself is totally off then this might not work. (This probably would be
the better pattern anyway.)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]