MCPcopy Create free account
hub / github.com/apache/tomcat / getLoggerName

Method getLoggerName

java/org/apache/catalina/startup/Tomcat.java:925–950  ·  view source on GitHub ↗
(Host host, String contextName)

Source from the content-addressed store, hash-verified

923 * Uses essentially the same logic as {@link ContainerBase#logName()}.
924 */
925 private String getLoggerName(Host host, String contextName) {
926 if (host == null) {
927 host = getHost();
928 }
929 StringBuilder loggerName = new StringBuilder();
930 loggerName.append(ContainerBase.class.getName());
931 loggerName.append(".[");
932 // Engine name
933 loggerName.append(host.getParent().getName());
934 loggerName.append("].[");
935 // Host name
936 loggerName.append(host.getName());
937 loggerName.append("].[");
938 // Context name
939 if (contextName == null || contextName.isEmpty()) {
940 loggerName.append('/');
941 } else if (contextName.startsWith("##")) {
942 loggerName.append('/');
943 loggerName.append(contextName);
944 } else {
945 loggerName.append(contextName);
946 }
947 loggerName.append(']');
948
949 return loggerName.toString();
950 }
951
952 /**
953 * Create the configured {@link Context} for the given <code>host</code>. The default constructor of the class that

Callers 4

silenceMethod · 0.95
formatMethod · 0.80

Calls 7

getHostMethod · 0.95
getNameMethod · 0.65
getParentMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45
isEmptyMethod · 0.45
startsWithMethod · 0.45

Tested by

no test coverage detected