6 Answers, 1 is accepted
0
Guest
Top achievements
Rank 1
answered on 29 Apr 2013, 09:40 AM
Hi Jim,
The SendLog API method can't send a text file directly: you will have to read the content of the file and send that as a byte-array, preferably including a matching mime-type (plain text, jpeg image, or what have you).
See also http://api.eqatec.com/analytics/dotnet/html/M_EQATEC_Analytics_Monitor_IAnalyticsMonitor_SendLog_1.htm
best regards,
Richard Flamsholt
EQATEC Team
0
Guest
Top achievements
Rank 1
answered on 29 Apr 2013, 09:40 AM
OK I've attached log files as required (I think)
example code
byte[] dataToSend = File.ReadAllBytes(files[0].ToString());
Program.monitor.SendLog("Activity log file", dataToSend.Length, "text/XML");
How do I access the log file from Dashbard?
0
Guest
Top achievements
Rank 1
answered on 29 Apr 2013, 09:40 AM
Hi Jim,
There's a small typo in your example, because obviously you want to send the byte array itself and not just the length of it:
Program.monitor.SendLog("Activity log file", dataToSend, "text/XML");
In answer to your question: there will be a small paperclip-icon prefixed to the log text when you view a Log Messages that has an attachment. When you click it, you can save the attached text to a file. Unfortunately we don't have any built-in viewers yet, so you will have to save it to file in order to view it.
best regards,
Richard Flamsholt
EQATEC Team
0
Guest
Top achievements
Rank 1
answered on 29 Apr 2013, 09:40 AM
Yip copy & paste error :-(
Got that working now.
Next question - can you attach multiple files?
0
Guest
Top achievements
Rank 1
answered on 29 Apr 2013, 09:40 AM
Hi Jim,
No, unfortunately not. We chose to keep the SendLog method as simple as possible, so it can just transfer one binary chunk at a time.
If you need to transfer multiple files then you should either submit multiple log-lines, each with it's own file content attached, or concatenate the file contents in some way, e.g. by zipping them together programatically and submitting that instead. I can recommend the open-source SharpZipLib, which works really well - we've used it for years ourselves.
best regards,
Richard Flamsholt
EQATEC Team
0
Guest
Top achievements
Rank 1
answered on 29 Apr 2013, 09:40 AM
OK fair enough.