Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable ClientHandlerThread debug logs #705

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions QuickFIXn/ClientHandlerThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public ExitedEventArgs(ClientHandlerThread clientHandlerThread)
private Thread thread_ = null;
private volatile bool isShutdownRequested_ = false;
private SocketReader socketReader_;
private FileLog log_;
private ILog log_;

[Obsolete("Don't use this constructor")]
public ClientHandlerThread(TcpClient tcpClient, long clientId)
Expand Down Expand Up @@ -62,15 +62,23 @@ public ClientHandlerThread(TcpClient tcpClient, long clientId, QuickFix.Dictiona
internal ClientHandlerThread(TcpClient tcpClient, long clientId, QuickFix.Dictionary settingsDict,
SocketSettings socketSettings, AcceptorSocketDescriptor acceptorDescriptor)
{
string debugLogFilePath = "log";
if (settingsDict.Has(SessionSettings.DEBUG_FILE_LOG_PATH))
debugLogFilePath = settingsDict.GetString(SessionSettings.DEBUG_FILE_LOG_PATH);
else if (settingsDict.Has(SessionSettings.FILE_LOG_PATH))
debugLogFilePath = settingsDict.GetString(SessionSettings.FILE_LOG_PATH);

// FIXME - do something more flexible than hardcoding a filelog
log_ = new FileLog(debugLogFilePath, new SessionID(
if (settingsDict.Has(SessionSettings.DISABLE_CLIENT_HANDLER_THREAD_LOGS)
&& settingsDict.GetBool(SessionSettings.DISABLE_CLIENT_HANDLER_THREAD_LOGS))
{
log_ = new NullLog();
}
else
{
string debugLogFilePath = "log";
if (settingsDict.Has(SessionSettings.DEBUG_FILE_LOG_PATH))
debugLogFilePath = settingsDict.GetString(SessionSettings.DEBUG_FILE_LOG_PATH);
else if (settingsDict.Has(SessionSettings.FILE_LOG_PATH))
debugLogFilePath = settingsDict.GetString(SessionSettings.FILE_LOG_PATH);

// FIXME - do something more flexible than hardcoding a filelog
log_ = new FileLog(debugLogFilePath, new SessionID(
"ClientHandlerThread", clientId.ToString(), "Debug-" + Guid.NewGuid().ToString()));
}

this.Id = clientId;
socketReader_ = new SocketReader(tcpClient, socketSettings, this, acceptorDescriptor);
Expand Down
1 change: 1 addition & 0 deletions QuickFIXn/SessionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class SessionSettings
public const string RECONNECT_INTERVAL = "ReconnectInterval";
public const string FILE_LOG_PATH = "FileLogPath";
public const string DEBUG_FILE_LOG_PATH = "DebugFileLogPath";
public const string DISABLE_CLIENT_HANDLER_THREAD_LOGS = "DisableClientHandlerThreadLogs";
public const string FILE_STORE_PATH = "FileStorePath";
public const string REFRESH_ON_LOGON = "RefreshOnLogon";
public const string RESET_ON_LOGON = "ResetOnLogon";
Expand Down