Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
0.10.0
Description
The documentation implies that `getTimeStamp` returns a timesamp in milliseconds, see:
/** Return the timeStamp of this event. */ inline log4cxx_time_t getTimeStamp() const { return timeStamp; }
and the member
/** The number of milliseconds elapsed from 1/1/1970 until logging event was created. */ log4cxx_time_t timeStamp;
The problem is that in the constructor of `LoggingEvent`, the timestamp is filled with `apr_time_now()` that returns a timestamp in microseconds, see:
LoggingEvent::LoggingEvent( const LogString& logger1, const LevelPtr& level1, const LogString& message1, const LocationInfo& locationInfo1) : logger(logger1), level(level1), ndc(0), mdcCopy(0), properties(0), ndcLookupRequired(true), mdcCopyLookupRequired(true), message(message1), timeStamp(apr_time_now()), locationInfo(locationInfo1), threadName(getCurrentThreadName()) { }
When encountered, the issue is not difficult to debug, but it would be nice to correct the documentation.