Can't you create several Loggers, each with its own FileHandler pointing to different files? You might then create an umbrella logging class that calls the correct one based on the level of the log message received.

If you must absolutely filter events by exact match, then you can attach a LevelMatchFilter to a given appender in order to filter out logging events by exact level match. The LevelMatchFilter is an instance of a custom filter. ... Note that the PropertyConfigurator does not support custom filters which can only be specified in configuration scripts expressed in XML format.

Pradeep Kadambar
Ranch Hand

Joined: Oct 18, 2004
Posts: 148

posted Mar 20, 2005 21:05:00

0

Does java.util.logging provide this LevelMatcherFilter ?

Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364

posted Mar 21, 2005 10:30:00

0

I don't see any filter implementations in the java.util.logging package.

boolean isLoggable(LogRecord record) Check if a given log record should be published. [ March 21, 2005: Message edited by: Carol Enderlin ]

Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364

posted Mar 21, 2005 10:33:00

0

I thought I'd mention that I've been quite satisfied with the way you describe the levels working. If each level is in a different log file it seems to me it would be harder to follow the context of an error. Your mileage or needs may vary.