SendLog

7 posts, 0 answers
  1. Guest
    Guest avatar
    506 posts
    Member since:
    Feb 2012

    Posted 29 Apr 2013 Link to this post

    How do I attach a text file when performing a SendLog
  2. Guest
    Guest avatar
    506 posts
    Member since:
    Feb 2012

    Posted 29 Apr 2013 Link to this post

    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
  3. Guest
    Guest avatar
    506 posts
    Member since:
    Feb 2012

    Posted 29 Apr 2013 Link to this post

    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?
  4. Guest
    Guest avatar
    506 posts
    Member since:
    Feb 2012

    Posted 29 Apr 2013 Link to this post

    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
  5. Guest
    Guest avatar
    506 posts
    Member since:
    Feb 2012

    Posted 29 Apr 2013 Link to this post

    Yip copy & paste error :-( Got that working now. Next question - can you attach multiple files?
  6. Guest
    Guest avatar
    506 posts
    Member since:
    Feb 2012

    Posted 29 Apr 2013 Link to this post

    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
  7. Guest
    Guest avatar
    506 posts
    Member since:
    Feb 2012

    Posted 29 Apr 2013 Link to this post

    OK fair enough.
Back to Top