Reputation: 16724
If an error occurrs, a log file,in "pure text" format will be created to then be sent by another application, the errorReportin.exe. That's a GUI application that will read and by using BackgroundWorker sent the file contents to my e-mail.
1-question: Do I need really to use some XML or JSON etc instead of simple text file? why? will I have some kind of problem by using this? I can't think one reason for don't use simple text file. It's easy to read, maybe by reading the e-mail only I can have a idea either solve the probrem.
2-question: Is dangerous make this file readable to anyone? do I need encrypt it or something like?
Until now, I'm loging StackTrace
and Message
from Exception
and Date
. Say if you think that I'm missing some information to do log.
Upvotes: 0
Views: 175
Reputation: 3433
Stacktrace is frowned upon in some places and others dump it into the log anyway. I don't see any reason why a simple log needs to be made complicated. Your application would then need to build XML etc.
Also why do you pass the log to a secondary process? Can the main application not just have a class (on a separate thread if need be) that waits on messages and logs them?
Upvotes: 1
Reputation: 8985
Use whatever file format makes sense for your application. XML and JSON are useful if you're conveying information with a number of different fields, but if it's a simple message then plain text is perfectly fine. In fact many applications pass simple text messages for inter-process communication.
This depends on the sensitivity of your data and whether it's exposed on the public internet. If the answer to both is yes, you should take steps to ensure the transport and/or message are protected.
Upvotes: 1