Details
-
Type:
Bug
-
Status: Won't Fix
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: log
-
Labels:None
-
Team:Data Facility
Description
During the configuration of properties, log can instantiate appender classes which can throw exceptions. In order to propagate this up to Python the following code needs to be added to the logLib.i Swig file:
%lsst_exceptions()
%include "lsst/pex/exceptions/exceptionsLib.i"
Attachments
Issue Links
- relates to
-
DM-1342 Write DM message appender class
- Done
The log4cxx code does things both ways. The log4cxx odbcappender can throw an exception, and the log4cxx sockethubappender prints an error. I went with throwing an exception in the EventAppender code because I thought it would be better to know that a broker host name needed to be configured rather than printing a message. The lsst.log pushContext method throws an exception if an invalid name is attempted to be added, so I figured this was the way to go.
The exception thrown in odbcappender can happen after the appender is configured. I believe the intent there is to attempt to catch that exception in the user's code, because there's a recovery mechanism in place to reconnect to the database if necessary. This goes against the philosophy of "it should always work" though.
I could do this either way, and at this point I'm leaning to writing the error to stdout the way log4cxx does for other errors. If that's OK with everyone, I'll just drop this ticket completely and change the EventAppender code appropriately. Follows up on the details of that will be in
DM-1342.