I have the following logback.xml file:
I think you can use MDC to change logging level programmatically. The code below is an example to change logging level on current thread. This approach does not create dependency to logback implementation (SLF4J API contains MDC).
LOG_LEVEL
DEBUG
TRACE
TRACE
DEBUG
DEBUG
INFO
INFO
WARN
WARN
ERROR
ERROR
......
MDC.put("LOG_LEVEL", "INFO");