use of org.apache.qpid.server.logging.LogSubject in project qpid-broker-j by apache.
the class AMQPConnectionActorTest method sendLogMessage.
private String sendLogMessage() {
final String message = "test logging";
Subject subject = new Subject(false, Collections.singleton(new ConnectionPrincipal(getConnection())), Collections.emptySet(), Collections.emptySet());
Subject.doAs(subject, new PrivilegedAction<Object>() {
@Override
public Object run() {
getEventLogger().message(new LogSubject() {
@Override
public String toLogString() {
return "[AMQPActorTest]";
}
}, new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return "test.hierarchy";
}
});
return null;
}
});
return message;
}
Aggregations