How to use the logentries.le.DefaultTransport function in Logentries

To help you get started, we’ve selected a few Logentries examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LogentriesCommunity / le_openshift / logentries / le.py View on Github external
smetrics = None

    # We need account and host ID to get server side configuration
    if config.pull_server_side_config:
        config.user_key_required(not config.daemon)
        config.agent_key_required()

    # Ensure all configured logs are created
    if config.configured_logs and not config.datahub:
        create_configured_logs(config.configured_logs)

    if config.daemon:
        daemonize()

    # Start default transport channel
    default_transport = DefaultTransport(config)

    # Register resource monitoring
    if config.agent_key != NOT_SET and config.v1_metrics != 'False':
        log.debug("Enabling V1 metrics")
        stats = Stats()
        stats.start()
    else:
        log.debug("V1 metrics disabled")
    formatter = formats.FormatSyslog(config.hostname, 'le',
                                     config.metrics.token)
    smetrics = metrics.Metrics(config.metrics, default_transport,
                                formatter, config.debug_metrics)
    smetrics.start()

    followers = []
    transports = []