1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.access.joran.action;
15
16 import ch.qos.logback.core.status.OnConsoleStatusListener;
17 import org.xml.sax.Attributes;
18
19 import ch.qos.logback.core.joran.action.Action;
20 import ch.qos.logback.core.joran.spi.InterpretationContext;
21 import ch.qos.logback.core.util.ContextUtil;
22 import ch.qos.logback.core.util.StatusPrinter;
23
24
25
26 public class ConfigurationAction extends Action {
27 static final String INTERNAL_DEBUG_ATTR = "debug";
28
29 public void begin(InterpretationContext ec, String name, Attributes attributes) {
30 String debugAttrib = attributes.getValue(INTERNAL_DEBUG_ATTR);
31
32 if (
33 (debugAttrib == null) || debugAttrib.equals("")
34 || debugAttrib.equals("false") || debugAttrib.equals("null")) {
35 addInfo("Ignoring " + INTERNAL_DEBUG_ATTR + " attribute.");
36 } else {
37 OnConsoleStatusListener.addNewInstanceToContext(context);
38 }
39
40 new ContextUtil(context).addHostNameAsProperty();
41
42
43 ec.pushObject(getContext());
44 }
45
46 public void end(InterpretationContext ec, String name) {
47 addInfo("End of configuration.");
48 ec.popObject();
49 }
50 }