Service service = server.findService(pname.getKeyProperty("service"));
Engine engine = (Engine) service.getContainer();
if (type.equals("Context")) {
Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
String pathStr = getPathStr(pname.getKeyProperty("path"));
Context context = (Context) host.findChild(pathStr);
((StandardContext)context).addValve(accessLogger);
} else if (type.equals("Engine")) {
((StandardEngine)engine).addValve(accessLogger);
} else if (type.equals("Host")) {
Host host = (Host) engine.findChild(pname.getKeyProperty("host"));