<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Redirect system console to file in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526637#M36326</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/answers/44112/view.html" target="_blank"&gt;Export Output Console&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#getviewtext" target="_blank"&gt;getviewtext(view)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#systemwindow" target="_blank"&gt;systemwindow(num)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#fileopen" target="_blank"&gt;fileopen(...)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#fpt" target="_blank"&gt;fpt(str)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#fileclose" target="_blank"&gt;fileclose()&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 25 Sep 2020 13:17:08 GMT</pubDate>
    <dc:creator>joerg_vogel_HsH</dc:creator>
    <dc:date>2020-09-25T13:17:08Z</dc:date>
    <item>
      <title>Redirect system console to file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526636#M36325</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 20.0.8 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Is there a way to redirect system console and output console messages to a file/files?&lt;/P&gt;&lt;P&gt;I have to debug a model where in a long-running Experiment some replications may randomly crash or get stuck. Unfortunately, these events are not reproducible (different replications may fail on a different Experiment Run). I'd like to see what was there in the system console just before the crash, to know what component/DLL to blame.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Sep 2020 08:44:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526636#M36325</guid>
      <dc:creator>sastanin</dc:creator>
      <dc:date>2020-09-24T08:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect system console to file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526637#M36326</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/answers/44112/view.html" target="_blank"&gt;Export Output Console&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#getviewtext" target="_blank"&gt;getviewtext(view)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#systemwindow" target="_blank"&gt;systemwindow(num)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#fileopen" target="_blank"&gt;fileopen(...)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#fpt" target="_blank"&gt;fpt(str)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/CommandReference/Commands.html#fileclose" target="_blank"&gt;fileclose()&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Sep 2020 13:17:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526637#M36326</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-09-25T13:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect system console to file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526638#M36327</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Thank you for the answer &lt;A rel="user" href="https://answers.flexsim.com/users/461/joerg.v.html" nodeid="461"&gt;@joerg.vogel&lt;/A&gt; but saving view text to file is not the same as redirecting console output to file. By redirection I mean that the output file is kept open all the time, and text is written to file as soon as it is printed to the console (or instead of). This is invaluable for debug, because if there is an exception dumped to the console, and then flexsim.exe crashes or enters an infinite loop, the last thing printed to the console will probably be saved. Custom event-triggered code may not get its chance to run at all before something bad happens, so saving view text to file is not only less efficient but it is also unreliable.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Sep 2020 13:57:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526638#M36327</guid>
      <dc:creator>sastanin</dc:creator>
      <dc:date>2020-09-25T13:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect system console to file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526639#M36328</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;In a child experiment, the system console output is written to a std::stringstream. When the experiment finishes, the contents of the stringstream are written to a node and passed back to the parent.&lt;/P&gt;&lt;P&gt;You can get the text of the stringstream programmatically using applicationcommand("getconsoletext", 2), but as you noted, if the program is crashing or in an infinite loop, you don't have a callback opportunity to execute this function.&lt;/P&gt;&lt;P&gt;You might be able to get some crashing information if you add an exfslogfile.txt to your FlexSim documents directory and/or C:\exfslogfile.txt. There's old code in the engine that prints exceptions and crashing info to those files if they exist, but we haven't recently tested or used them to know whether they will be helpful or not.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Sep 2020 14:19:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526639#M36328</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2020-09-25T14:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect system console to file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526640#M36329</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Thank you for the suggestion. I tried exfslogfile.txt, it may help, but probably won't. It seems to be overwritten by the last replication. And also registers only the first exception. So we're out of luck if any other replication crashes.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="33043-1601377776700.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1503731iDB5B58CCBB55072B/image-size/large?v=v2&amp;amp;px=999" role="button" title="33043-1601377776700.png" alt="33043-1601377776700.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:10:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526640#M36329</guid>
      <dc:creator>sastanin</dc:creator>
      <dc:date>2020-09-29T11:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect system console to file</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526641#M36330</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;If you put the file in both your documents and C: directory, then the one in the C: directory gets the full system console text instead of just the first exception.&lt;/P&gt;&lt;P&gt;It still only shows for the last replication though.&lt;/P&gt;&lt;P&gt;Maybe you can run the experiment with 1 Max Core and stop it once you get to the crashing replication?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="33046-1601395864019.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1503732i7AA8673E9D3B589F/image-size/large?v=v2&amp;amp;px=999" role="button" title="33046-1601395864019.png" alt="33046-1601395864019.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There is code that creates new files with numbers appended, but that requires write permission on the root C: drive folder, which is difficult. (This code dates back to the Windows XP days when everything was run as administrator and everything had access to everywhere.)&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:12:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/redirect-system-console-to-file/m-p/13526641#M36330</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2020-09-29T16:12:30Z</dc:date>
    </item>
  </channel>
</rss>

