Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Export Log

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Export Log

    How do you export the log using Ninja Script. Ideally I would like to export by category.

    #2
    Hello cutzpr,

    Thank you for the post.

    I wanted to clarify your question, are you asking to export the automatically generated logs that you see in the control center? If so, that would already be saved in the log folder: Documents\NinjaTrader 8\log

    Can you confirm if this is what you are looking for or what specific log you are referring to?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Yes, I would like to be able to export it via ninja script, possibly filtered by category. Why you may ask? I am building a remote monitoring tool for my strategies and I would rather send the log as events, as they occur instead of having to build a file watcher service and parse the complete log just for the latest entry.

      Comment


        #4
        Hello,

        Thank you for the reply.

        Yes, in this case, I would be unaware of any existing method to export the internal log as that related to the entire platform and not a specific object. There are only documented ways to write to the log but not to retrieve log entries.

        You would likely need to read the log file if you wanted to see all of the platform events, otherwise, if you are only looking for events from your scripts I would likely suggest using a different logging method.

        If the intended goal is to review it later in an external program and that program is something you developed you could likely create a C# way to pass that data to your program bypassing the platform logging. If this is a third party program you did not create, you would likely need to use whatever means that program has to load the data which may entail reading the log file.

        I would caution reading directly from the files in the user folder, in case any of the files get locked that could cause problems in NinjaTrader if it tries to read or write that file.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          If the intended goal is to review it later in an external program and that program is something you developed you could likely create a C# way to pass that data to your program bypassing the platform logging. If this is a third party program you did not create, you would likely need to use whatever means that program has to load the data which may entail reading the log file.
          I was hoping to be able to in realtime pass log entries to a webserver so I can remotely check the status of NT and the strategies. Could you please create a feature request on my behalf, to either add the ability to export the log with filtering parameters or create an event when log entries are added that can be subscribed to within ninjascript.

          Comment


            #6
            Hello cutzpr,

            Thank you for the reply.

            I will put in a feature request for a method to retrieve log entries. As it is now, you could technically pass any logging you have in your strategy to your web server using C# means from each individual strategies logic. For the platforms other logging that would need a feature request which I have submitted, you can track it with the ID: SFT-3368.

            I look forward to being of further assistance.
            Last edited by NinjaTrader_Jesse; 07-20-2018, 06:50 AM.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by PhillT, Today, 02:16 PM
            2 responses
            6 views
            0 likes
            Last Post PhillT
            by PhillT
             
            Started by Kaledus, Today, 01:29 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by frankthearm, Yesterday, 09:08 AM
            14 responses
            47 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by gentlebenthebear, Today, 01:30 AM
            2 responses
            14 views
            0 likes
            Last Post gentlebenthebear  
            Started by PaulMohn, Today, 12:36 PM
            2 responses
            17 views
            0 likes
            Last Post PaulMohn  
            Working...
            X