Initializes the handler with a specific host address and port. When the attribute *closeOnError* is set to True - if a socket error occurs, the socket is silently closed and then reopened on the next logging call.
(self, host, port)
| 558 | """ |
| 559 | |
| 560 | def __init__(self, host, port): |
| 561 | """ |
| 562 | Initializes the handler with a specific host address and port. |
| 563 | |
| 564 | When the attribute *closeOnError* is set to True - if a socket error |
| 565 | occurs, the socket is silently closed and then reopened on the next |
| 566 | logging call. |
| 567 | """ |
| 568 | logging.Handler.__init__(self) |
| 569 | self.host = host |
| 570 | self.port = port |
| 571 | if port is None: |
| 572 | self.address = host |
| 573 | else: |
| 574 | self.address = (host, port) |
| 575 | self.sock = None |
| 576 | self.closeOnError = False |
| 577 | self.retryTime = None |
| 578 | # |
| 579 | # Exponential backoff parameters. |
| 580 | # |
| 581 | self.retryStart = 1.0 |
| 582 | self.retryMax = 30.0 |
| 583 | self.retryFactor = 2.0 |
| 584 | |
| 585 | def makeSocket(self, timeout=1): |
| 586 | """ |