.net SDK Logging

As you know application has it own configuration on appsetting.json and having another file for SDK logging is not best option.

I was trying to set the configuration object with logger and then set the apiclient instance with configuration.
But always it gets over-written with the default irrespective of file exist on the default path or not.

Are there any options I have missed or recommendation so that we can fully utilize the SDK logging with reload option plz?

It might help clarify if you showed what you were trying in your code. this works fine for me;

Configuration.Default.Logger.Format = LogFormat.Text;
Configuration.Default.Logger.Level = LogLevel.LDebug;
Configuration.Default.Logger.LogFilePath = @"C:\Archives\Genesys\Native.log";
Configuration.Default.Logger.LogRequestBody = true;
Configuration.Default.Logger.LogResponseBody = true;

As does;

Configuration.Default.ConfigFilePath = @"C:\Archives\Genesys\Config.json";
Configuration.Default.AutoReloadConfig = true;

and

Configuration.Default.ConfigFilePath = @"C:\Archives\Genesys\Config.ini";
Configuration.Default.AutoReloadConfig = true;

ini:

[logging]
log_level = debug
log_format = text
log_to_console = false
log_file_path = C:\Archives\Genesys\ini.log
log_response_body = true
log_request_body = true

json:

{
    "logging": {
        "log_level": "debug",
        "log_format": "text",
        "log_to_console": false,
        "log_file_path": "C:\\Archives\\Genesys\\json.log",
        "log_response_body": true,
        "log_request_body": true
    }
}

Hi,

I'm not very familiar with ASP.NET development.
If the SDK is being used in an environment where the logging configuration file is being overwritten then you will need to use the logging configuration in code and the auto-reload functionality will unfortunately be unavailable.

Thank you @Eos_Rios and @anon11147534 - Both the messages help me identify my mistake. I will retry and confirm here ..

1 Like

Thank you - I have not got it all working with automatic update on config change :slight_smile:
Happy for this query to be marked as closed

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.