-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path__init__.py
More file actions
30 lines (22 loc) · 1005 Bytes
/
__init__.py
File metadata and controls
30 lines (22 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import logging
from stackify.constants import AGENT_LOG_URL
from stackify.transport.agent import agent_http
from stackify.transport.agent import agent_socket
from stackify.transport.base import AgentBaseTransport
internal_logger = logging.getLogger(__name__)
class AgentSocketTransport(AgentBaseTransport):
"""
Agent Socket Transport handles sending of logs using Unix Socket Domain
"""
def __init__(self, api_config, env_details):
super(AgentSocketTransport, self).__init__(api_config, env_details)
self.url = api_config.socket_url + AGENT_LOG_URL
self._transport = agent_socket.AgentSocket()
class AgentHTTPTransport(AgentBaseTransport):
"""
Agent HTTP Transport handles sending of logs using HTTP requests
"""
def __init__(self, api_config, env_details):
super(AgentHTTPTransport, self).__init__(api_config, env_details)
self.url = api_config.http_endpoint + AGENT_LOG_URL
self._transport = agent_http.AgentHTTP()