I need to log to file sensor's data of the device which is connected to my PC. It should include timestamps also. I wonder, what is the proper format to store this sort of data? So, later I can rea开发者_JAVA百科d it easily in the Notepad and parse it from the software also.
You can use log4net with a FileAppender
You could use Log4net and log either to database or to text file.
I would also consider to log to a MS Message Queue just for the sake of decoupling the sensor reads from the actual log writing, then from another process you can peek the messages and process them separately... but this really depends on how robust and fault-proof you want to make your solution...
精彩评论