get a HTTP[S]Connection. Override when a custom connection is required, for example if there is a proxy.
(self, host, secure)
| 1259 | return record.__dict__ |
| 1260 | |
| 1261 | def getConnection(self, host, secure): |
| 1262 | """ |
| 1263 | get a HTTP[S]Connection. |
| 1264 | |
| 1265 | Override when a custom connection is required, for example if |
| 1266 | there is a proxy. |
| 1267 | """ |
| 1268 | import http.client |
| 1269 | if secure: |
| 1270 | connection = http.client.HTTPSConnection(host, context=self.context) |
| 1271 | else: |
| 1272 | connection = http.client.HTTPConnection(host) |
| 1273 | return connection |
| 1274 | |
| 1275 | def emit(self, record): |
| 1276 | """ |