[jboss-jira] [JBoss JIRA] (WFCORE-606) Accessing attribute message from class LoggingEvent always returns class String
James Perkins (Jira)
issues at jboss.org
Thu May 16 20:43:00 EDT 2019
[ https://issues.jboss.org/browse/WFCORE-606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Perkins closed WFCORE-606.
--------------------------------
Resolution: Won't Fix
I'm closing this as won't fix, however if you feel this should be relooked at please feel free to reopen this.
> Accessing attribute message from class LoggingEvent always returns class String
> -------------------------------------------------------------------------------
>
> Key: WFCORE-606
> URL: https://issues.jboss.org/browse/WFCORE-606
> Project: WildFly Core
> Issue Type: Enhancement
> Components: Logging
> Environment: Windows 7, JDK 1.7.0_51
> Reporter: Jörg Brück
> Assignee: James Perkins
> Priority: Minor
>
> After Changing from JBoss 5.1.0 to Wildfly the behaviour of my own written Log4j appenders
> have changed while accessing LoggingEvent in the function "append" of
> class ApppenderSkeleton.
> The reason of this behaviour is the implementation of org.apache.log4j.spi.LoggingEvent
> public LoggingEvent(String fqnOfCategoryClass, Category logger, long timeStamp, Priority level, Object message, Throwable throwable) {
> this.fqnOfCategoryClass = fqnOfCategoryClass;
> this.logger = logger;
> this.level = level;
> logRecord = new ExtLogRecord(JBossLevelMapping.getLevelFor(level), message == null ? null : message.toString(), ExtLogRecord.FormatStyle.NO_FORMAT, fqnOfCategoryClass);
> The Object message is converted to string and saved in Class ExtLogRecord.
> Here the implementation of getMessage:
> public Object getMessage() {
> return logRecord.getMessage();
> }
> Here the implementation of getMessage of ExtLogRecord
> public String getMessage() {
> return message;
> }
> Because of this String is always returned.
> If I understand this code right you can transfer every object to log4j, but you can not access this objects
> in an appender because of the LoggingEvent constructor where method toString is called.
> What is the reason of this change in contrast to jboss 5.1.0?
> Of course I can reconstruct my objects from the string if I overwrite the toString method.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list