diff --git a/Source/Applications/openHistorian/openHistorian/ServiceHost.cs b/Source/Applications/openHistorian/openHistorian/ServiceHost.cs index 45c34394ed..ce7443d3af 100644 --- a/Source/Applications/openHistorian/openHistorian/ServiceHost.cs +++ b/Source/Applications/openHistorian/openHistorian/ServiceHost.cs @@ -1041,7 +1041,14 @@ private void SetupGrafanaHostingAdapter() // Define default adapter connection string if none is defined if (string.IsNullOrWhiteSpace(actionAdapter.ConnectionString)) - actionAdapter.ConnectionString = $"FileName={DefaultGrafanaServerPath}; WorkingDirectory=Grafana; ForceKillOnDispose=True; ProcessOutputAsLogMessages=True; LogMessageTextExpression={{(?<=.*msg\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*file\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*file\\s*\\=\\s*)[^\\s]*(?=s|$)|(?<=.*path\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*path\\s*\\=\\s*)[^\\s]*(?=s|$)|(?<=.*error\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*reason\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*id\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*version\\s*\\=\\s*)[^\\s]*(?=\\s|$)|(?<=.*dbtype\\s*\\=\\s*)[^\\s]*(?=\\s|$)|(?<=.*)commit\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)compiled\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)address\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)protocol\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)subUrl\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)code\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*name\\s*\\=\\s*)[^\\s]*(?=\\s|$)}}; LogMessageLevelExpression={{(?<=.*lvl\\s*\\=\\s*)[^\\s]*(?=\\s|$)}}; LogMessageLevelMappings={{info=Info; warn=Waning; error=Error; critical=Critical; debug=Debug}}"; + actionAdapter.ConnectionString = actionAdapter.ConnectionString = + $"FileName={DefaultGrafanaServerPath}; " + + "WorkingDirectory=Grafana; " + + "ForceKillOnDispose=True; " + + "ProcessOutputAsLogMessages=True; " + + "LogMessageTextExpression={(?<=.*msg\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*file\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*file\\s*\\=\\s*)[^\\s]*(?=s|$)|(?<=.*path\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*path\\s*\\=\\s*)[^\\s]*(?=s|$)|(?<=.*error\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*reason\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*id\\s*\\=\\s*\\\")[^\\\"]*(?=\\\")|(?<=.*version\\s*\\=\\s*)[^\\s]*(?=\\s|$)|(?<=.*dbtype\\s*\\=\\s*)[^\\s]*(?=\\s|$)|(?<=.*)commit\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)compiled\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)address\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)protocol\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)subUrl\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*)code\\s*\\=\\s*[^\\s]*(?=\\s|$)|(?<=.*name\\s*\\=\\s*)[^\\s]*(?=\\s|$)}; " + + "LogMessageLevelExpression={(?<=.*lvl\\s*\\=\\s*)[^\\s]*(?=\\s|$)}; " + + "LogMessageLevelMappings={info=Info; warn=Waning; error=Error; critical=Critical; debug=Debug}"; // Preserve connection string on existing records except for Grafana server executable path that comes from configuration file Dictionary settings = actionAdapter.ConnectionString.ParseKeyValuePairs();