THE QUESTION: Is it possible to provide another constructor for
              org.apache.log4j.spi.LoggingEvent, something like:

              LoggingEvent( long timeStamp,     // <-- this is new
                            String fqnOfCategoryClass,
                            Category logger,
                            Priority priority,
                            Object message,
                            Throwable throwable )

THE PROBLEM: I cannot change/set the field timeStamp in LoggingEvent

THE SITUATION: 

Implementing a log4j-logging-subsystem I am forced to provide
an interface for legacy applications written in C or even in
unix shell scripts.

We have agreed on using a XML-document containing all necessary
logging information. These XML-documents are created by the legacy
applications and written into a message queue.

An separate java program is started sometimes and processes the
log-XML-documents on the behalf of the legacy applications using
log4j. Therefore I am constructing a LoggingEvent manually and
calling Logger.callAllAppenders() so I can still use the power and
flexibility of log4j (appenders, filters, file-rolling...).

The problem is, that I am unable to set the timeStamp field of
LoggingEvent to the time, the log event was created by the
legacy application (contained in the XML-document).

In the current implementation of LoggingEvent the timeStamp is set
in the constructor to the time the instance of LoggingEvent is
created and cannot be changed anymore (declared as "public FINAL").

As far as LocationInfo is concerned, it is still possible to
extend LoggingEvent and provide my own settings.

IMHO the above mentioned constructor costs nothing and the timeStamp
field in LoggingEvent could still stay "public FINAL"!

Best regards,
Christian Kedl


--
Diese E-Mail wurde mit http://www.mail-inspector.de verschickt
Mail Inspector ist ein kostenloser Service von http://www.is-fun.net
Der Absender dieser E-Mail hatte die IP: 193.194.7.84


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to