Cannot filter for custom LogEntry

i’ve written a custom LogEntry by extending the SimpleLogEntry-class (see below).

public class MyLogEntry extends SimpleLogEntry {

    public MyLogEntry(@NotNull String log) {

    public MyLogEntry(@NotNull String log, @Nullable Date time) {
        super(log, time);

    public String getLog() {
        return "<div>" + getUnstyledLog() + "</div>";

    public String getCssStyle() {
        return "bambooMyLog";

    public LogEntry cloneAndMutate(final String newUnstyledLog) {
        return new MyLogEntry(newUnstyledLog, getDate());

Now i want to filter for entries of that type by using

final BuildLogFileAccessor fileAccessor = buildLogFileAccessorFactory.createBuildLogFileAccessor(buildResultsSummary.getPlanKey(), buildResultsSummary.getBuildNumber());
List<LogEntry> myLogs = fileAccessor.getLastNLogsOfType(1000, Lists.newArrayList(MyLogEntry.class));

Unfortunately this list remains empty. When i add SimpleLogEntry.class to the ArrayList my logs appear together with all the other logs. I’ve not found which attribute i need to overwrite so the fileAccessor-filtering works as expected.

turns out that it’s not possible to add custom LogEntry-Types to Bamboo.

See convertToLogFileEntry() in BuildLogUtils.class, which is called to create persistent logs. Here the four default LogEntry types are hardcoded with SimpleLogEntry as fallback…

    public static String convertToLogFileEntry(@NotNull LogEntry logEntry) {
        StringBuilder fileEntry = new StringBuilder();
        if (logEntry instanceof ErrorLogEntry) {
        } else if (logEntry instanceof BuildOutputLogEntry) {
        } else if (logEntry instanceof CommandLogEntry) {
        } else {

        String logText = logEntry.getUnstyledLog();
        if (logText != null) {
            logText = StringUtils.remove(logText, '\n');

        return fileEntry.toString();

Maybe i’ll just add a prefix to all log messages of my custom TaskType so i can filter for them in Results frontend later.