//e.g. a worker thread like in Search or UpdateEfficiency worker
//TODO:pb:check if this was also a problem with IM threads.
ureq = tld.getHttpServletRequest();
}
UserSession usess = null;
Identity identity = null;
String remoteIp = null;
String userAgent = null;
String referer = null;
if (ureq != null) {
usess = UserSession.getUserSessionIfAlreadySet(ureq);
if (usess != null) {
identity = usess.getIdentity();
remoteIp = ureq.getRemoteAddr();
userAgent = ureq.getHeader("User-Agent");
referer = ureq.getHeader("Referer");
}
}
StringBuilder sb = new StringBuilder();
if (!Settings.isDebuging()) {
sb.append(PREFIX);
sb.append(category);
sb.append(SEPARATOR);
try {
// Node-Id + Error number e.g. N1-E17
sb.append("N");
//FIXME:gs remove access to coordinator: gs accessing coordinator here loads the corespring factory. This means we cannot do unit testing without olat
// as the first log call will start the whole OLAT stuff.
sb.append(CoordinatorManager.getCoordinator().getNodeId());
sb.append("-");
} catch (Throwable th) {
//ok
sb.append(N_A);
}
sb.append(prefix);
sb.append(refNum);
sb.append(SEPARATOR);
sb.append(callingClass == null ? N_A : callingClass.getPackage().getName());
sb.append(SEPARATOR);
sb.append(identity == null ? N_A : identity.getName());
sb.append(SEPARATOR);
sb.append(remoteIp == null ? N_A : remoteIp);
sb.append(SEPARATOR);
sb.append(referer == null ? N_A : referer);
sb.append(SEPARATOR);