Skip to content

Connection types and how to change them #2

@tomasr78

Description

@tomasr78

What default client to post messages is used, HttpClient or WebSocket? How to change it? What connection type do you suggest?

We use Microsoft.Extensions.Logging framework and our code is below.

public static class Logger
{
    private static ILoggerFactory _factory;

    public static ILogger Main => LoggerFactory.CreateLogger(AppConstants.AppName);

    public static ILoggerFactory LoggerFactory
    {
        get
        {
            if (_factory == null)
            {
                _factory = new LoggerFactory();
                try
                {
                    _factory.AddLogDNA(new LogDNAOptions(AppConstants.LogDnaKey)
                    {
                        HostName = AppConstants.ServerName,
                        LogLevel = AppConstants.LogLevel
                    });
                }
                catch (Exception e)
                {
                    //Catch if logger initialization fail
                    Console.WriteLine(e);
                }
            }
            return _factory;
        }
        set => _factory = value;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions