• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 digibob, Today, 02:47 AM
            0 responses
            1 view
            0 likes
            Last Post digibob
            by digibob
             
            Started by NinjaCustomer, Today, 12:57 AM
            1 response
            4 views
            0 likes
            Last Post NinjaCustomer  
            Started by lancasterstephen, Today, 12:09 AM
            1 response
            5 views
            0 likes
            Last Post lancasterstephen  
            Started by liltr3d, Yesterday, 10:52 PM
            0 responses
            4 views
            0 likes
            Last Post liltr3d
            by liltr3d
             
            Started by Longhornmark, Yesterday, 08:25 AM
            3 responses
            13 views
            0 likes
            Last Post bltdavid  
            Working...
            X