public override void Execute() { GetLogs logs = new GetLogs(); string data = logs.GetAll_WithCommand(); data.SendDataString(Comm.Client_Socket); }
public async Task <IEnumerable <AppLog> > Handle(GetLogs request, CancellationToken cancellationToken) { using (var con = new SqlConnection("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=Procurement;Integrated Security=True;")) { var query = @"SELECT Distinct([TimeStamp]), JSON_VALUE(LogEvent, '$.Properties.Name') AS [Action], JSON_VALUE(LogEvent, '$.Properties.UserName') AS UserName FROM [Procurement].[dbo].[Logs] WHERE [Message] like 'Request:%' "; var logs = await con.QueryAsync <AppLog>(query); return(logs); } }
private void Button_Click(object sender, RoutedEventArgs e) { bool run = true; if (lifx.IsChecked == true) { LIFX lifx = new LIFX(); lifx.lifxEnabled = true; System.Windows.Controls.TextBox lifxKey = (System.Windows.Controls.TextBox)sender; string lifxKeyString = lifxKey.Text; lifx.lifxKeyString = lifxKeyString; // setup lifx } if (chroma.IsChecked == true) { Chroma chroma = new Chroma(); chroma.chromaEnabled = true; // setup chroma } if (cue.IsChecked == true) { // setup cue } if (hue.IsChecked == true) { // setup hue } while (run) { string log = GetLogs.GetLogFile(this.logFolder); } }
public object Any(GetLogs request) { return ((StringBuilderLogFactory)LogManager.LogFactory).GetLogs(); }
public object Any(GetLogs request) { return(((StringBuilderLogFactory)LogManager.LogFactory).GetLogs()); }
/// <summary> /// the constructor. /// </summary> private ModelCommunication() { ///getting a tcpClient instance. client = TcpClientChannel.GetInstance(); //if not already connected then connect. if (!TcpClientChannel.connected) { try { //connecting to the server and setting the connected boolean to true. TcpClientChannel.Connect(8000); connected = true; } catch (Exception) { //connection failed. connected = false; } } //If we connected we will continue if (TcpClientChannel.connected) { try { Task t = new Task(() => { //Receiving messages. while (true) { MessageToClient message; //getting all things that relate to the message. try { message = client.recieveMessage(); } catch (Exception) { connected = false; return; } int id = message.TypeMessage; string content = message.Content; bool allClients = message.AllClients; //Check to who transfer the message if (id == (int)SendClientEnum.AddLog) { AddLog?.Invoke(this, content); } if (id == (int)SendClientEnum.RemoveHandler) { RemoveHandler?.Invoke(allClients, content); } if (id == (int)SendClientEnum.GetConfig) { GetConfig?.Invoke(this, content); } if (id == (int)SendClientEnum.GetLogs) { GetLogs?.Invoke(this, content); } } }); t.Start(); } catch (Exception) { connected = false; } } }