mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3219 - add prefix to mdc keys
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1084576 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6f5b224ef4
commit
3da9f1c6ea
|
@ -474,7 +474,7 @@ public class BrokerService implements Service {
|
|||
return;
|
||||
}
|
||||
|
||||
MDC.put("broker", brokerName);
|
||||
MDC.put("activemq.broker", brokerName);
|
||||
|
||||
try {
|
||||
if (systemExitOnShutdown && useShutdownHook) {
|
||||
|
@ -543,7 +543,7 @@ public class BrokerService implements Service {
|
|||
}
|
||||
throw e;
|
||||
} finally {
|
||||
MDC.remove("broker");
|
||||
MDC.remove("activemq.broker");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ public class BrokerService implements Service {
|
|||
return;
|
||||
}
|
||||
|
||||
MDC.put("broker", brokerName);
|
||||
MDC.put("activemq.broker", brokerName);
|
||||
|
||||
if (systemExitOnShutdown) {
|
||||
new Thread() {
|
||||
|
@ -648,7 +648,7 @@ public class BrokerService implements Service {
|
|||
}
|
||||
}
|
||||
|
||||
MDC.remove("broker");
|
||||
MDC.remove("activemq.broker");
|
||||
|
||||
stopper.throwFirstException();
|
||||
}
|
||||
|
|
|
@ -298,7 +298,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
|||
}
|
||||
|
||||
public Response service(Command command) {
|
||||
MDC.put("connector", connector.getUri().toString());
|
||||
MDC.put("activemq.connector", connector.getUri().toString());
|
||||
Response response = null;
|
||||
boolean responseRequired = command.isResponseRequired();
|
||||
int commandId = command.getCommandId();
|
||||
|
@ -330,7 +330,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
|||
}
|
||||
context = null;
|
||||
}
|
||||
MDC.remove("connector");
|
||||
MDC.remove("activemq.connector");
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
|
@ -1364,7 +1364,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
|
|||
* @see org.apache.activemq.thread.Task#iterate()
|
||||
*/
|
||||
public boolean iterate() {
|
||||
MDC.put("destination", getName());
|
||||
MDC.put("activemq.destination", getName());
|
||||
boolean pageInMoreMessages = false;
|
||||
synchronized (iteratingMutex) {
|
||||
|
||||
|
@ -1481,7 +1481,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
|
|||
if (pendingWakeups.get() > 0) {
|
||||
pendingWakeups.decrementAndGet();
|
||||
}
|
||||
MDC.remove("destination");
|
||||
MDC.remove("activemq.destination");
|
||||
return pendingWakeups.get() > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ public class VMTransportFactory extends TransportFactory {
|
|||
broker = BrokerFactory.createBroker(brokerURI);
|
||||
}
|
||||
broker.start();
|
||||
MDC.put("broker", broker.getBrokerName());
|
||||
MDC.put("activemq.broker", broker.getBrokerName());
|
||||
} catch (URISyntaxException e) {
|
||||
throw IOExceptionSupport.create(e);
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ public class VMTransportFactory extends TransportFactory {
|
|||
if (broker != null) {
|
||||
ServiceSupport.dispose(broker);
|
||||
}
|
||||
MDC.remove("broker");
|
||||
MDC.remove("activemq.broker");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,12 +31,12 @@ log4j.rootLogger=INFO, out, stdout
|
|||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n
|
||||
#log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{broker} %-20.20X{connector} %-10.10X{destination} - %m%n
|
||||
#log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n
|
||||
|
||||
# File appender
|
||||
log4j.appender.out=org.apache.log4j.FileAppender
|
||||
log4j.appender.out.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n
|
||||
#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{broker} %-20.20X{connector} %-10.10X{destination} - %m%n
|
||||
#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n
|
||||
log4j.appender.out.file=target/activemq-test.log
|
||||
log4j.appender.out.append=true
|
||||
|
|
|
@ -51,13 +51,13 @@ log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
|
|||
log4j.appender.logfile.layout.ConversionPattern=%d | %-5p | %m | %c | %t%n
|
||||
# use some of the following patterns to see MDC logging data
|
||||
#
|
||||
# %X{broker}
|
||||
# %X{connector}
|
||||
# %X{destination}
|
||||
# %X{activemq.broker}
|
||||
# %X{activemq.connector}
|
||||
# %X{activemq.destination}
|
||||
#
|
||||
# e.g.
|
||||
#
|
||||
# log4j.appender.logfile.layout.ConversionPattern=%d | %-20.20X{connector} | %-5p | %m | %c | %t%n
|
||||
# log4j.appender.logfile.layout.ConversionPattern=%d | %-20.20X{activemq.connector} | %-5p | %m | %c | %t%n
|
||||
|
||||
###########
|
||||
# Audit log
|
||||
|
|
Loading…
Reference in New Issue