public String format(long logid, Map<String, ValueGenerator> generators, Map<String, String> staticParams) {
		StringBuffer sb = new StringBuffer();
		for (String token: tokens) {
			if (isPlaceholder(token)) {
				String key = token.substring(2, token.length() - 2);
				String param = null;
				if (key.contains(":")) {
					param = key.substring(key.indexOf(":") + 1);
					key = key.substring(0, key.indexOf(":"));
				}
				ValueGenerator valueGenerator = generators != null ? generators.get(key) : null;
				if (valueGenerator != null)
					sb.append(valueGenerator.nextValue(logid, format, Collections.unmodifiableCollection(tokens), param));
				else if (staticParams != null && staticParams.containsKey(key))
					sb.append(staticParams.get(key));
				else
					sb.append(token);
			} else {
				sb.append(token);
			}
		}
		return sb.toString();
	}