Skip to content

MetaTrader 4 Log#

About#

MetaTrader 4 log model

Fields#

Name Type Required Description
code number Yes Log message type. -1 - folder, 0 - information message, 1 - warning, 2 - error message, 3 - critical error message, 4 - system login message
type number Yes Event type. 0 - All types of events, 1 - Events of configuration changes, 2 - System events, 3 - Events related to the network activity, 4 - Events associated with price data, 5 - Events associated with users, 6 - Trade events, 7 - Events associated with the Server API, 16 - Events associated with the Live Update service, 17 - Events associated with email.
flags number Yes Log entry flags. 0 - The log does not have flags, 1 - The log has an invalid checksum (damaged or changed from outside).
datetimeInSeconds number Yes Date and time of a message in seconds that have elapsed since 01.01.1970.
datetimeInMilliseconds number Yes Date and time of a message in milliseconds that have elapsed since 01.01.1970.
source string Yes Source of the message
message string Yes Message text

Example#

{
  "code": 0,
  "type": 0,
  "flags": 0,
  "datetimeInSeconds": 26884358091,
  "datetimeInMilliseconds": 16130614854606,
  "source": "MetaQuotes-Demo",
  "message": "log message"
}

Usage#