none
Sending continuous logs from one application to Another in C# RRS feed

  • Question

  • I am having two Application running Independently with can be web or windows. One application is ApplicationSend and another is ApplicationRecive.

    The ApplicationSend keep logging info into the database or Text file. when the ApplicationSend logs info, it needs to display in ApplicationRecive at the same time without any delay.

    The ApplicationRecive uses rest API to display the data.

    I am having 2 questions here

    1. How this can be achieved in C#. Please note the application dont know about each other. Also one application can be windows and other can be web.
    2. When the rest API Display 10 logs, next time should it query for all the logs or only the updated logs?. Ideally it should be only updated logs. But how to get only updated logs
    3. As of now ApplicationRecive can be a window application. can be changed in the alter point.

    I am visualstudio 2017.

    What are the options I am having to achieve this task. I need to do a POC for this and need to submit by friday.

    Any link or peice of code is much appreciated


    Tuesday, May 22, 2018 1:56 PM

All replies

  • I'm afraid your requirements are a little too vague to be able to come up with a good solution. There are so many different ways to go depending upon requirements you haven't even mentioned yet.

    • What happens if ApplicationReceive isn't running
    • Where is ApplicationSend sending its data to if they don't know about each other
    • What API does ApplicationReceive gets its data from and where is that API getting its data
    • Are the apps on the same machine, network, etc.

    The list goes on and on. My gut instinct would be that you simply have an API that ApplicationSend calls to "write" log entries to a database. ApplicationReceive can then use the same API to read that data. How and how much it reads is up to the application. In most APIs you can specify filtering and paging options. In this case you might say "get me the next 10 entries since noon" or "get me the next 100 entries between some start and end date". Given such an API you can then easily build an application that can view historical information or current information and fetch it however it wants.


    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, May 22, 2018 6:13 PM
    Moderator
  • There are a few nice solution for logging. Log into database of text file is nice but there are limitations (disk space, db structures, to much complicated find out what are happening). Problem is that when you start analyze log records then you had problem in past. You cannot capture moment when problem starts. 

    Very nice solution is using of message queue. It could be consumed by logstash, sentry, etc... and it is better solution than everything you will write by own. 

    Wednesday, May 23, 2018 3:42 AM