Log4net
  1. Log4net
  2. LOG4NET-141

Add CreateConnection method to AdoNetAppender to allow subclasses to have control of IDbConnection.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.11
    • Component/s: Appenders
    • Labels:
      None

      Description

      The IDbConnection is created in the private method InitializeDatabaseConnection. Use the Connection property to set the connection object does not work when a reconnect is required. Add a CreateConnection method to allow sub-classes that handle creating their own connection.

        Activity

        Hide
        Lowe, Loren added a comment -

        Hi,
        I have been looking at the log4net api and DO NOT see how to set the Connection property directly (as the documentation states). I do not have access to the Connection string property directly, but want to just set the connection i.e. AdoNetAppender.Connection = MyApp.MyDal.Connection.

        Can this be done?

        The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Under Florida law, e-mail addresses are public records. If you do not want your e-mail address released in response to a public-records request, do not send electronic mail to this entity. Instead, contact this office by phone or in writing.

        Show
        Lowe, Loren added a comment - Hi, I have been looking at the log4net api and DO NOT see how to set the Connection property directly (as the documentation states). I do not have access to the Connection string property directly, but want to just set the connection i.e. AdoNetAppender.Connection = MyApp.MyDal.Connection. Can this be done? The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Under Florida law, e-mail addresses are public records. If you do not want your e-mail address released in response to a public-records request, do not send electronic mail to this entity. Instead, contact this office by phone or in writing.
        Hide
        Ron Grabowski added a comment -

        Fixed in r628555.

        Show
        Ron Grabowski added a comment - Fixed in r628555.
        Hide
        Ron Grabowski added a comment -

        Added CreateConnection method that accepts the resolve connection Type and the resolved connection string. Refactored duplicate code for closing/disposing the IDbCommand IDbConnection objects into DIsposeCommand/Connection.

        Show
        Ron Grabowski added a comment - Added CreateConnection method that accepts the resolve connection Type and the resolved connection string. Refactored duplicate code for closing/disposing the IDbCommand IDbConnection objects into DIsposeCommand/Connection.

          People

          • Assignee:
            Ron Grabowski
            Reporter:
            Ron Grabowski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development