in gshell-commands/gshell-log4j/src/main/java/org/apache/geronimo/gshell/commands/log4j/MdcAction.java [48:71]
public Object execute(final CommandContext context) throws Exception {
assert context != null;
IO io = context.getIo();
if (remove) {
MDC.remove(name);
}
else if (name != null && value != null) {
MDC.put(name, value);
}
else if (name != null) {
io.info("{}", MDC.get(name));
}
else {
Map map = MDC.getContext();
if (map != null) {
for (Object key : map.keySet()) {
io.info("{}={}", key, map.get(key));
}
}
}
return Result.SUCCESS;
}