Logging Plugin Incompatibility
From release 2.1, Codebeamer’s logging capabilities were improved to be better able to trace executions happening inside plugin code. This is in place helping the support and developer staff to ensure the service quality of Codebeamer in case we need to obtain logs from our customers to investigate performance issues.
The logging augmentation of the code has a limitation, that it cannot work on Java classes marked as "final". Since customers can also add their own plugin code to the system, those are also in the scope of this requirement.
We are validating if all runtime customer code match this criteria.
In case a class which does not meet this criteria is found, a warning is
Written to the Codebeamer log during startup:
2023-08-02 10:09:14,870 WARN codebeamer.context.CodebeamerApplicationInitializer - The following plugin classes are incompatible with server-side logging and will be not augmented: class com.intland.codebeamer.BadTrackerItemListener. Please modify these classes to be non-final. [RMI TCP Connection(4)-127.0.0.1] [34] {Req#=StartUp, Sess#=StartUp, serverId=server}
And the following error message is displayed on the System Administrator page of Codebeamer:
The plugin code is still functional despite this, but the extra logging facilities are unable to augment these code paths.
How to fix?
Customers needs to manually fix and recompile their plugin classes in question. This can be as simple as removing the "final"designator on the Java class listed by the warning message seen above.
We provide two example classes to demonstrate the differences. Both write an example log message to the Codebeamer log when a new tracker item is created.
When the plugin code is correct, the log message has the "pluggableCode" attribute present with the full name of the plugin code being executed.
For BadTrackerItemListener, the following is an example of a sample log entry:
2023-08-02 10:10:22,611 INFO intland.codebeamer.BadTrackerItemListener - This is not logged in pluggable context. [catalina-exec-3] [40] {Req#=189, Sess#=063..94f, serverId=server}
For GoodTrackerItemListener, the following is an example of a sample log entry:
2023-08-02 10:10:32,391 INFO intland.codebeamer.GoodTrackerItemListener - This is logged in pluggable context. [catalina-exec-3] [40] {Req#=189, Sess#=063..94f, pluggableCode=eventListener:com.intland.codebeamer.GoodTrackerItemListener.trackerItemCreated, serverId=server}
Example Java Classes
BadTrackerItemListener.class
package com.intland.codebeamer;

@org.springframework.stereotype.Component

public final class BadTrackerItemListener implements com.intland.codebeamer.event.TrackerItemListener {

private static final org.apache.logging.log4j.Logger log;

public BadTrackerItemListener() { /* compiled code */ }

public void trackerItemCreated(com.intland.codebeamer.event.BaseEvent<com.intland.codebeamer.persistence.dto.TrackerItemDto,com.intland.codebeamer.persistence.dto.TrackerItemDto,com.intland.codebeamer.manager.util.ActionData> event) throws com.intland.codebeamer.event.util.VetoException { /* compiled code */ }

}
BadTrackerItemListener.java
package com.intland.codebeamer;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

import com.intland.codebeamer.event.BaseEvent;
import com.intland.codebeamer.event.TrackerItemListener;
import com.intland.codebeamer.event.util.VetoException;
import com.intland.codebeamer.manager.util.ActionData;
import com.intland.codebeamer.persistence.dto.TrackerItemDto;

/**
* This class is incompatible with server-side logging and will be not augmented.
* - The class name is listed in the application startup log as incompatible.
* - If this class is present, the sysadmin page shows an error regarding incompatibility.
* - The log message created by this class on tracker item creation does not have the extra 'pluggableCode' listing.
*/

@Component
public final class BadTrackerItemListener implements TrackerItemListener {
private static final Logger log = LogManager.getLogger(BadTrackerItemListener.class);

public void trackerItemCreated(BaseEvent < TrackerItemDto,TrackerItemDto, ActionData> event) throws VetoException {
log.info("This is not logged in pluggable context.");
}


}
GoodTrackerItemListener.class
package com.intland.codebeamer;

@org.springframework.stereotype.Component
public class GoodTrackerItemListener implements com.intland.codebeamer.event.TrackerItemListener {

private static final org.apache.logging.log4j.Logger log;
public GoodTrackerItemListener() { /* compiled code */ }
public void trackerItemCreated(com.intland.codebeamer.event.BaseEvent<com.intland.codebeamer.persistence.dto.TrackerItemDto,com.intland.codebeamer.persistence.dto.TrackerItemDto,com.intland.codebeamer.manager.util.ActionData> event) throws com.intland.codebeamer.event.util.VetoException { /* compiled code */ }
}
GoodTrackerItemListener.java
package com.intland.codebeamer;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

import com.intland.codebeamer.event.BaseEvent;
import com.intland.codebeamer.event.TrackerItemListener;
import com.intland.codebeamer.event.util.VetoException;
import com.intland.codebeamer.manager.util.ActionData;
import com.intland.codebeamer.persistence.dto.TrackerItemDto;

/**
* This class is compatible with server-side logging.
* - The class name is not listed in the application startup log as incompatible.
* - If only this class is present then the sysadmin page shows no plugin compatibility error.
* - The log message created by this class on tracker item creation has the extra 'pluggableCode' listing mentioning
* the class's name.
*/
@Component
public class GoodTrackerItemListener implements TrackerItemListener {

private static final Logger log = LogManager.getLogger(GoodTrackerItemListener.class);

log.info( " This is logged in pluggable context." );

}

}
Was this helpful?