Log()
Log()
Definition
Generates a NinjaScript category log event record and associated time stamp which is output to the Log tab of the NinjaTrader Control Center / Account Data windows. The Log() method also writes records to the NinjaTrader log file which can be useful for supporting 3rd party code.
- Log events do NOT process to the NinjaScript output window. For temporary logging, please see the Print() method and Output window.
- The Log event time stamp represents the user configured Time zone from the Tools > Options > General category. This setting could be different from the computer system’s time zone.
Method Return Value
This method does not return a value.
Syntax
Log(string message, LogLevel logLevel)
Each call to this method creates a log entry which takes memory to keep loaded in the Log tab of the Control Center. Excessive logging can result in huge portions of memory being allocated to display the log messages. Please see the NinjaScript section of the Performance Tips article for more information.

