I'm having trouble getting a log message to display the right way. I'm using this Log4J pattern layout:
pattern="ORDERID : $${ctx:ORDERID} %msg%n"
I want to see output like:
ORDERID: 123 Test Context
But this is the output I am getting:
ORDERID : ${ctx:ORDERID} Test Context
This is the code that's generating the log message:
@Test
public void testThreadContext() {
ThreadContext.push("Message only");
ThreadContext.push("int", 1);
ThreadContext.push("int-long-string", 1, 2L, "3");
ThreadContext.push("ORDERID", "123");
logger.info("Test Context");
ThreadContext.clearAll();
}