
Hello, I would like to switch an existing system from log4j to Logback. The current system extends org.apache.log4j.Level to define some custom additional levels and uses Logger#log(Priority priority, Object message) with the custom Level as priority. Is there a similar way to extend Logback with additional levels? Regards, Lars

In logback the Level class is final and cannot be extended. However, you can use markers instead. Markers are part of the SLF4J API. What does your custom level do? On 28/07/2010 5:04 PM, Lars Fischer wrote:
Hello,
I would like to switch an existing system from log4j to Logback. The current system extends org.apache.log4j.Level to define some custom additional levels and uses
Logger#log(Priority priority, Object message)
with the custom Level as priority.
Is there a similar way to extend Logback with additional levels?
Regards, Lars

Hello Ceki, 2010/7/28 Ceki Gülcü <ceki@qos.ch>:
In logback the Level class is final and cannot be extended. However, you can use markers instead. Markers are part of the SLF4J API.
Yes, this is my problem ;)
What does your custom level do?
The custom levels separate different visibilities on top of the default levels (something like DebugCore, DebugUser) and are filtered with a LevelMatchFilter. But the markers are a better alternative than extending the original level. Thank you very much! Regards, Lars
participants (2)
-
Ceki Gülcü
-
Lars Fischer