i am using logback for logging and in logback.xml i have Console appender as
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>.
i am trying to achieve something like this...
time thread |-**CUSTOMLOGLEVEL** xyz.class - Message.
Why ? i want to filter the messages easily by defining the loglevel or some other indicator.
for example: search logs with log level "CUSTOMLOGLEVEL". Is there any way to give custom log level or any other indicator which shows that this is custom generated log and not some framework generated log..
i went into direction of creating custom class .
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="com.logging.CustomLayout">
<param name="argument1" value="1" />
<param name="argument2" value="2" />
</layout>
</encoder>
</appender>
but i am not sure how i will give input externally to these parameters.
In case i am not clear please let me know .