I'm making a vehicle tracking application(ASP.NET MVC C#). I have windows service that takes data sent by GPS device. In the service I have written the code to Log the data.
Now consider a normal logging scenario in which i have only one GPS device.
08:00:24 Inside OnDataAvailable Method
08:00:25 Data Received - Device Id: 2 Data: abcdefghijkl
08:00:25 Leaving OnDataAvailable
and few more statements. and then it repeats
Now when I have more than one GPS device sending data, the log gets mixed. That is I have following kind of log:
08:00:23 Inside OnDataAvailable Method 08:00:24 Inside OnDataAvailable Method
08:00:25 Data Received - Device Id: 2 Data: abcdefghijkl
08:00:25 Leaving OnDataAvailable
08:00:26 Data Received - Device Id: 1 Data: abcdefghijkl
08:00:26 Leaving OnDataAvailable
Now what I want to achieve is that, I should have different log files for different devices. So for device with Id 1 I have Log_D1.txt, For Device Id 2, Log_D2.txt.
Would appreciate if someone can point me in the right direction.